Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Anti-AB mAbs Treatment #1522

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/main/java/org/mitre/synthea/engine/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@ public static class Attribute extends Logic {
@Override
public boolean test(Person person, long time) {
try {
if (value instanceof String) {
value = person.attributes.getOrDefault(value, value);
}
return Utilities.compare(person.attributes.get(attribute), value, operator);
} catch (Exception e) {
String message = "Attribute Logic error: " + attribute + " " + operator + " " + value;
Expand Down
14 changes: 11 additions & 3 deletions src/main/java/org/mitre/synthea/export/FhirR4.java
Original file line number Diff line number Diff line change
Expand Up @@ -2726,9 +2726,11 @@ private static BundleEntryComponent carePlan(Person person,
reason = carePlan.reasons.get(0);
narrative += "<br/>Care plan is meant to treat " + reason.display + ".";

Reference reasonRef = careplanResource.addAddresses();
reasonRef.setDisplay(reason.display);
reasonCondition = findConditionResourceByCode(bundle, reason.code);
if (reasonCondition != null) {
careplanResource.addAddresses().setReference(reasonCondition.getFullUrl());
reasonRef.setReference(reasonCondition.getFullUrl());
}
}

Expand All @@ -2750,7 +2752,9 @@ private static BundleEntryComponent carePlan(Person person,
activityDetailComponent.setCode(mapCodeToCodeableConcept(activity, SNOMED_URI));

if (reasonCondition != null) {
activityDetailComponent.addReasonReference().setReference(reasonCondition.getFullUrl());
activityDetailComponent.addReasonReference()
.setReference(reasonCondition.getFullUrl())
.setDisplay(reason.display);
} else if (reason != null) {
activityDetailComponent.addReasonCode(mapCodeToCodeableConcept(reason, SNOMED_URI));
addTranslation("ICD10-CM", reason, activityDetailComponent.getReasonCodeFirstRep(),
Expand All @@ -2768,7 +2772,11 @@ private static BundleEntryComponent carePlan(Person person,
for (JsonObject goal : carePlan.goals) {
BundleEntryComponent goalEntry =
careGoal(person, bundle, personEntry, carePlan.start, goalStatus, goal);
careplanResource.addGoal().setReference(goalEntry.getFullUrl());
String display = ((Goal) goalEntry.getResource())
.getDescription().getCoding().get(0).getDisplay();
careplanResource.addGoal()
.setReference(goalEntry.getFullUrl())
.setDisplay(display);
}

careplanResource.setText(new Narrative().setStatus(NarrativeStatus.GENERATED)
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/org/mitre/synthea/helpers/ModuleOverrides.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,11 @@ private List<String> handleElement(String path, String currentElementName, JsonE
JsonObject jo = element.getAsJsonObject();

for (String field : jo.keySet()) {
// note: spaces have to be escaped in properties file key
String safeFieldName = field.replace(" ", "\\ ").replace(":", "\\:");
// note: some characters have to be escaped in properties file key
String safeFieldName = field
.replace(" ", "\\ ")
.replace(":", "\\:")
.replace("'", "\\\\'");
JsonElement fieldValue = jo.get(field);
parameters.addAll(handleElement(path + "['" + safeFieldName + "']", field, fieldValue));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"name": "anti_amyloid_beta_monoclonal_antibody_infusions",
"remarks": [
"This module depends on the Dementia and Anti-Amyloid-Beta Monoclonal Antibody Treatment modules, and uses the shared medications/anti_ab_mabs_selection submodule."
],
"states": {
"Initial": {
"type": "Initial",
"direct_transition": "Wait Until Study is Active"
},
"Wait Until Study is Active": {
"type": "Guard",
"allow": {
"condition_type": "And",
"conditions": [
{
"condition_type": "Attribute",
"attribute": "anti-ab-mab-ced-study",
"operator": "is not nil"
},
{
"condition_type": "Attribute",
"attribute": "anti-ab-mab-ced-study",
"operator": "==",
"value": true
}
]
},
"direct_transition": "Wait for Infusion Appointment"
},
"Wait for Infusion Appointment": {
"type": "Delay",
"distribution": {
"kind": "EXACT",
"parameters": {
"value": 2
}
},
"unit": "weeks",
"conditional_transition": [
{
"transition": "Infusion Encounter",
"condition": {
"condition_type": "Attribute",
"attribute": "anti-ab-mab-ced-study",
"operator": "==",
"value": true
}
},
{
"transition": "Wait for Infusion Appointment"
}
]
},
"Infusion Encounter": {
"type": "Encounter",
"encounter_class": "ambulatory",
"reason": "Type of Alzheimer's",
"telemedicine_possibility": "none",
"codes": [
{
"system": "SNOMED-CT",
"code": "387760006",
"display": "Infusion care (regime/therapy)"
}
],
"direct_transition": "Receive_mAbs"
},
"End Encounter": {
"type": "EncounterEnd",
"direct_transition": "Wait for Infusion Appointment"
},
"Receive_mAbs": {
"type": "CallSubmodule",
"submodule": "medications/anti_ab_mabs_selection",
"direct_transition": "End Encounter"
}
},
"gmf_version": 2
}
Loading
Loading