Skip to content

fixes latest P21 Community findings#72

Merged
swhume merged 1 commit intomainfrom
p21-sdtm
Apr 13, 2026
Merged

fixes latest P21 Community findings#72
swhume merged 1 commit intomainfrom
p21-sdtm

Conversation

@swhume
Copy link
Copy Markdown
Collaborator

@swhume swhume commented Apr 13, 2026

Here are fixes for the P21 Community issues I could resolve. This is Issue #71. I added some comments in the P21 issue report that I will share via Slack. I also fixed a few other small issues.

@swhume swhume requested a review from dostiep April 13, 2026 02:03
# assumption: 1 class per dataset - many need to expand this for ADaM
if dataset.get("observationClass", {}).get("name", ""):
ds_class = dataset.get("observationClass", {}).get("name", "").upper().replace("-", " ")
ds_class = dataset["observationClass"]["name"].upper().replace("-", " ")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to create the code to address subclasses or should we wait until we get to ADaM?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the content is available in the DDS, then yes, I'll add it in the next update.

:param attr: ItemRef template attributes to update with optional values
:param obj: variable definition dictionary from the DDS JSON
"""
# TODO does method exist on items in the DDS?
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Methods don't exist in DDS though some of them (i.e. BMI) have a origin type set to Derived, which triggers an issue in P21 as it expects a method.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added Methods to cases with an origin type of Derived. I added the MethodOID to the ItemRef and then generated a MethodDef. The BMI example looks like this:

<MethodDef OID="MT.VS.VSORRES.BMI" Name="Derive VSORRES BMI" Type="Computation"> <Description> <TranslatedText xml:lang="en">__PLACEHOLDER__ for derivation of VSORRES BMI</TranslatedText> </Description> </MethodDef>

"Originator": "360i Define-XML Team",
"SourceSystem": "odmlib",
"SourceSystemVersion": "0.2",
"Context": "Other",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Context could also have as a value "Submission". Where should this information come from?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My original thinking was that we were generating a Define-XML Spec, so it would be Other. Now I think it would be good to provide the Context as input, possibly with a default value of Other. It's important because having a Submission context triggers additional conformance rules. This could be added as a command-line argument/

ir.WhereClauseRef.append(wc)
applicable_when = item.get("applicableWhen") or []
if applicable_when:
# TODO when there are multiple applicableWhen values only the first is wired up
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that mean the "OR" statement is not supported?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's what it means. If DDS supports it, I'll add it in the next update.

I'll go through all the remaining TODOs and address as many as I can.

Copy link
Copy Markdown
Collaborator

@dostiep dostiep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made a few comments, nothing major, just questions I have mostly. Otherwise, it looks pretty good.

@swhume swhume merged commit 01f63f3 into main Apr 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants