Skip to content

Commit ca66cb6

Browse files
committed
Updates for tickets #950 #944 #934 #917 #954 #953 #911
Add FAQs and eCRNowAppUpgrade instructions
1 parent 16cd1b2 commit ca66cb6

File tree

11 files changed

+371
-392
lines changed

11 files changed

+371
-392
lines changed

FAQs renamed to FAQs.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,29 @@ Typically vendors are starting off with a 4 CPU, 16GB RAM, 500GB or 1TB hard dis
88

99
**2. How do I get notification of changes and releases ?**
1010

11-
eCRNow App releases are scheduled for the last monday of every month typically. You can subsribe to github notifications to get notified of new releases.
11+
eCRNow App releases are scheduled for the last Monday of every month typically. You can subscribe to github notifications to get notified of new releases.
1212

1313
**3. How do I get the latest eRSD and be notified of changes in eRSD versions ?**
1414

15-
All eRSD related documentation including downloading eRSD's and subscribing for eRSD changes are docuemnted at https://ersd.aimsplatform.org/#/home
16-
P
15+
All eRSD related documentation including downloading eRSD's and subscribing for eRSD changes are documented at https://ersd.aimsplatform.org/#/home
16+
17+
**4. How do I update my production releases of eCRNow ?**
18+
19+
Please refer to the eCRNowAppUpgrade.md instructions.
20+
21+
22+
23+
**5. How do I update my eRSD files to latest version ?**
24+
25+
Please refer to the MultipleERSDConfiguration.md instructions.
26+
27+
**6. How do I configure custom-queries ?**
28+
29+
Please refer to the CustomQueryConfiguration.md instructions.
30+
31+
**7. How do I protect the eCRNow App APIs ?**
32+
33+
Please refer to the Security Configuration.md instructions.
34+
35+
1736

OffHourConfiguration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ All the pending processing will be queued up for the OffHours, so the EHRs FHIR
5050
pending load should be tuned for optimal performance.
5151

5252
#4. Timezone supported for offhours #
53-
The only timezone currently supported for off hour configuration is UTC.
53+
The only time zone currently supported for off hour configuration is UTC.

eCRNowAppUpgrade.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
** Upgrading eCRNow App releases between any 3.X release (for e.g, 3.1.1 to 3.1.12)**
2+
3+
The following steps should be followed for updating the eCRNow App releases.
4+
5+
1. Download the release that you desire to use and test the release in your test environment.
6+
2. After verification of the release, stop the notification process to eCRNow. This stops invoking the launchPatient or reLaunchPatient or reProcessPatient API calls.
7+
3. Stop the eCRNow App
8+
4. Apply the DB changes using the DB Scripts provided in psql_db_scripts or msql_db_scripts folder as applicable to your environment. For example, if you are migrating from 3.1.1 to 3.1.11 apply the scripts in the folder v3.1.1_to_v3.1.11_db_changes.
9+
5. Once the DB changes are completed, deploy the latest eCRNow App.
10+
6. Restart the eCRNow App.
11+
7. After maybe 5 to 10 minutes, restart your notification feed that was stopped in Step 2. The reason for the 5 to 10 minutes to ensure any old timers that exist are executed.

src/main/java/com/drajer/bsa/utils/R3ToR2DataConverterUtils.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ public static void addResourcesToR4FhirData(
439439
List<Observation> vaccineCredObs = new ArrayList<>();
440440
List<Observation> residencyObs = new ArrayList<>();
441441
List<Observation> nationalityObs = new ArrayList<>();
442+
List<Observation> pregnancyIntentionObs = new ArrayList<>();
442443

443444
for (Resource r : socObs) {
444445
Observation sochisObs = (Observation) r;
@@ -516,6 +517,11 @@ public static void addResourcesToR4FhirData(
516517
logger.info(" Found Nationality Observation ");
517518
nationalityObs.add(sochisObs);
518519
}
520+
521+
if(sochisObs.hasCode() && isPregnancyIntentionObservation(sochisObs.getCode())) {
522+
logger.info(" Found Pregnancy Intention Observation ");
523+
pregnancyIntentionObs.add(sochisObs);
524+
}
519525
}
520526

521527
r4FhirData.addOccupationObs(occObs);
@@ -530,6 +536,7 @@ public static void addResourcesToR4FhirData(
530536
r4FhirData.addVaccineCredObs(vaccineCredObs);
531537
r4FhirData.addResidencyObs(residencyObs);
532538
r4FhirData.addNationalityObs(nationalityObs);
539+
r4FhirData.addPregnancyIntentionObs(pregnancyIntentionObs);
533540
}
534541

535542
} else if (type.contentEquals(ResourceType.Specimen.toString())) {
@@ -754,6 +761,26 @@ public static Boolean isPregnancyStatusObservation(CodeableConcept cd) {
754761

755762
return false;
756763
}
764+
765+
public static Boolean isPregnancyIntentionObservation(CodeableConcept cd) {
766+
767+
if (cd != null && cd.hasCoding()) {
768+
769+
List<Coding> cds = cd.getCoding();
770+
771+
for (Coding c : cds) {
772+
773+
if (c.hasCode()
774+
&& c.hasSystem()
775+
&& ((c.getCode().contentEquals(CdaGeneratorConstants.PREGNANCY_INTENTION_CODE)
776+
&& c.getSystem().contains("http://loinc.org")))) {
777+
return true;
778+
}
779+
}
780+
}
781+
782+
return false;
783+
}
757784

758785
public static Boolean isLastMenstrualPeriodObservation(CodeableConcept cd) {
759786

src/main/java/com/drajer/cda/utils/CdaGeneratorConstants.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,12 @@ private CdaGeneratorConstants() {
468468
public static final String TRIGGER_CODE_LAB_RESULT_TEMPLATE_ID_EXT = "2016-12-01";
469469
public static final String PLANNED_PROC_TRIGGER_TEMPLATE = "2.16.840.1.113883.10.20.15.2.3.42";
470470
public static final String PLANNED_PROC_TRIGGER_TEMPLATE_EXT = "2021-01-01";
471+
public static final String SPECIMEN_TEMPLATE_ID = "2.16.840.1.113883.10.20.22.4.415";
472+
public static final String SPECIMEN_TEMPLATE_ID_EXT = "2018-09-01";
473+
public static final String SPECIMEN_COLLECTION_CODE = "17636008";
474+
public static final String PARTICIPANT_TEMPLATE_ID = "2.16.840.1.113883.10.20.22.4.410";
475+
public static final String PARTICIPANT_TEMPLATE_ID_EXT = "2018-09-01";
476+
471477
public static final String QRDA_LAB_RESULTS_TEMPLATE_ID = "2.16.840.1.113883.10.20.24.3.40";
472478
public static final String QRDA_LAB_TEST_PERFORMED_TEMPLATE_ID =
473479
"2.16.840.1.113883.10.20.24.3.38";
@@ -615,9 +621,11 @@ private CdaGeneratorConstants() {
615621
public static final String LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE =
616622
"2.16.840.1.113883.10.20.15.2.3.4";
617623
public static final String LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE_EXT = "2016-12-01";
624+
public static final String LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE_EXT_31 = "2019-04-01";
618625
public static final String LAB_TEST_RESULT_OBSERVATION_TRIGGER_TEMPLATE =
619626
"2.16.840.1.113883.10.20.15.2.3.2";
620627
public static final String LAB_TEST_RESULT_OBSERVATION_TRIGGER_TEMPLATE_EXT = "2016-12-01";
628+
public static final String LAB_TEST_RESULT_OBSERVATION_TRIGGER_TEMPLATE_EXT_31 = "2019-04-01";
621629
public static final String PLANNED_PROCEDURE_TRIGGER_CODE_TEMPLATE =
622630
"2.16.840.1.113883.10.20.15.2.3.42";
623631
public static final String PLANNED_PROCEDURE_TRIGGER_CODE_TEMPLATE_EXT = "2021-01-01";
@@ -654,6 +662,10 @@ private CdaGeneratorConstants() {
654662
public static final String LMP_TEMPLATE_ID_EXT = "2014-06-09";
655663
public static final String LMP_CODE = "8665-2";
656664
public static final String LMP_DISPLAY = "Last Menstrual Period";
665+
public static final String PREGNANCY_INTENTION_CODE = "86645-9";
666+
public static final String PREGNANCY_INTENTION_CODE_DISPLAY = "Pregnancy Intention";
667+
public static final String PREGNANCY_INTENTION_TEMPLATE_ID = "2.16.840.1.113883.10.20.22.4.281";
668+
public static final String PREGNANCY_INTENTION_TEMPLATE_ID_EXT = "2018-04-01";
657669
public static final String PP_TEMPLATE_ID = "2.16.840.1.113883.10.20.22.4.285";
658670
public static final String PP_TEMPLATE_ID_EXT = "2018-04-01";
659671
public static final String PP_CODE = "249197004";

src/main/java/com/drajer/cdafromr4/CdaPlanOfTreatmentGenerator.java

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public static String generatePlanOfTreatmentSection(
134134

135135
rowNum++;
136136

137-
potObsXml.append(getPlannedObservationXml(s, details, contentRef, data));
137+
potObsXml.append(getPlannedObservationXml(s, details, contentRef, data, version));
138138
}
139139

140140
for (DiagnosticReport dr : reports) {
@@ -159,7 +159,7 @@ public static String generatePlanOfTreatmentSection(
159159

160160
rowNum++;
161161

162-
drXml.append(getDiagnosticReportXml(dr, details, contentRef, data));
162+
drXml.append(getDiagnosticReportXml(dr, details, contentRef, data, version));
163163
}
164164

165165
for (ServiceRequest p : procReqs) {
@@ -416,7 +416,7 @@ public static String getPlannedMedicationXml(
416416
}
417417

418418
public static String getPlannedObservationXml(
419-
ServiceRequest sr, LaunchDetails details, String contentRef, R4FhirData data) {
419+
ServiceRequest sr, LaunchDetails details, String contentRef, R4FhirData data, String version) {
420420

421421
StringBuilder sb = new StringBuilder();
422422

@@ -449,10 +449,18 @@ public static String getPlannedObservationXml(
449449

450450
if (!mCd.isEmpty()) {
451451

452-
sb.append(
453-
CdaGeneratorUtils.getXmlForTemplateId(
454-
CdaGeneratorConstants.LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE,
455-
CdaGeneratorConstants.LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE_EXT));
452+
if(version.contentEquals("CDA_R31")) {
453+
sb.append(
454+
CdaGeneratorUtils.getXmlForTemplateId(
455+
CdaGeneratorConstants.LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE,
456+
CdaGeneratorConstants.LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE_EXT_31));
457+
}
458+
else {
459+
sb.append(
460+
CdaGeneratorUtils.getXmlForTemplateId(
461+
CdaGeneratorConstants.LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE,
462+
CdaGeneratorConstants.LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE_EXT));
463+
}
456464

457465
codeXml =
458466
CdaGeneratorUtils.getXmlForCDWithValueSetAndVersion(
@@ -542,7 +550,7 @@ public static String getPlannedObservationXml(
542550
}
543551

544552
public static String getDiagnosticReportXml(
545-
DiagnosticReport dr, LaunchDetails details, String contentRef, R4FhirData data) {
553+
DiagnosticReport dr, LaunchDetails details, String contentRef, R4FhirData data, String version) {
546554

547555
StringBuilder sb = new StringBuilder();
548556

@@ -575,10 +583,18 @@ public static String getDiagnosticReportXml(
575583

576584
if (!mCd.isEmpty()) {
577585

586+
if(version.contentEquals("CDA_R31")) {
587+
sb.append(
588+
CdaGeneratorUtils.getXmlForTemplateId(
589+
CdaGeneratorConstants.LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE,
590+
CdaGeneratorConstants.LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE_EXT_31));
591+
}
592+
else {
578593
sb.append(
579594
CdaGeneratorUtils.getXmlForTemplateId(
580595
CdaGeneratorConstants.LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE,
581596
CdaGeneratorConstants.LAB_TEST_ORDER_TRIGGER_CODE_TEMPLATE_EXT));
597+
}
582598

583599
codeXml =
584600
CdaGeneratorUtils.getXmlForCDWithValueSetAndVersion(

src/main/java/com/drajer/cdafromr4/CdaPregnancyGenerator.java

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ public static String generatePregnancySection(
4141
List<Observation> lmpObs = data.getLmpObs();
4242
List<Observation> postPartumObs = data.getPostPartumObs();
4343
List<Observation> pregOutcomeObs = data.getPregnancyOutcomeObs();
44+
List<Observation> pregnancyIntentionObs = data.getPregnancyIntentionObservations();
4445

4546
if ((pregObs != null && !pregObs.isEmpty())
4647
|| (pregConds != null && !pregConds.isEmpty())
4748
|| (lmpObs != null && !lmpObs.isEmpty())
4849
|| (postPartumObs != null && !postPartumObs.isEmpty())
50+
|| (pregnancyIntentionObs != null && !pregnancyIntentionObs.isEmpty())
4951
|| (pregOutcomeObs != null && !pregOutcomeObs.isEmpty())) {
5052

5153
logger.info("Found Pregnancy Conditions or Observations ");
@@ -96,6 +98,11 @@ public static String generatePregnancySection(
9698
processPregOutcomeObservation(po, details, sb, pregObsXml, rowNum);
9799
rowNum++;
98100
}
101+
102+
for(Observation pi : pregnancyIntentionObs) {
103+
processPregnancyIntentionObservation(pi, details, sb, pregObsXml, rowNum);
104+
rowNum++;
105+
}
99106

100107
// Close the Table.
101108
sb.append(CdaGeneratorUtils.getXmlForEndElement(CdaGeneratorConstants.TABLE_BODY_EL_NAME));
@@ -119,6 +126,86 @@ public static String generatePregnancySection(
119126

120127
return sb.toString();
121128
}
129+
130+
private static void processPregnancyIntentionObservation(
131+
Observation pi,
132+
LaunchDetails details,
133+
StringBuilder table,
134+
StringBuilder pregObsXml,
135+
int rowNum) {
136+
137+
StringBuilder sb = new StringBuilder();
138+
139+
Map<String, String> bodyvals = new LinkedHashMap<>();
140+
bodyvals.put(
141+
CdaGeneratorConstants.PREGNANCY_OBSERVATION_TABLE_COL_1_BODY_CONTENT,
142+
CdaGeneratorConstants.PREGNANCY_INTENTION_CODE_DISPLAY);
143+
144+
bodyvals.put(
145+
CdaGeneratorConstants.PREGNANCY_OBSERVATION_TABLE_COL_2_BODY_CONTENT,
146+
CdaFhirUtilities.getStringForType(pi.getValue()));
147+
table.append(CdaGeneratorUtils.addTableRow(bodyvals, rowNum));
148+
149+
sb.append(CdaGeneratorUtils.getXmlForStartElement(CdaGeneratorConstants.ENTRY_EL_NAME));
150+
sb.append(
151+
CdaGeneratorUtils.getXmlForAct(
152+
CdaGeneratorConstants.OBS_ACT_EL_NAME,
153+
CdaGeneratorConstants.OBS_CLASS_CODE,
154+
CdaGeneratorConstants.MOOD_CODE_INT));
155+
156+
sb.append(
157+
CdaGeneratorUtils.getXmlForTemplateId(CdaGeneratorConstants.PREGNANCY_INTENTION_TEMPLATE_ID));
158+
sb.append(
159+
CdaGeneratorUtils.getXmlForTemplateId(
160+
CdaGeneratorConstants.PREGNANCY_INTENTION_TEMPLATE_ID,
161+
CdaGeneratorConstants.PREGNANCY_INTENTION_TEMPLATE_ID_EXT));
162+
163+
sb.append(CdaGeneratorUtils.getXmlForII(pi.getIdElement().getIdPart()));
164+
165+
sb.append(
166+
CdaGeneratorUtils.getXmlForCD(
167+
CdaGeneratorConstants.CODE_EL_NAME,
168+
CdaGeneratorConstants.PREGNANCY_INTENTION_CODE,
169+
CdaGeneratorConstants.LOINC_CODESYSTEM_OID,
170+
CdaGeneratorConstants.LOINC_CODESYSTEM_NAME,
171+
CdaGeneratorConstants.PREGNANCY_INTENTION_CODE_DISPLAY));
172+
173+
sb.append(
174+
CdaGeneratorUtils.getXmlForCD(
175+
CdaGeneratorConstants.STATUS_CODE_EL_NAME, CdaGeneratorConstants.COMPLETED_STATUS));
176+
177+
Pair<Date, TimeZone> start = null;
178+
Pair<Date, TimeZone> end = null;
179+
if (pi.hasEffective() && pi.getEffective() instanceof Period) {
180+
181+
Period p = (Period) pi.getEffective();
182+
start = CdaFhirUtilities.getActualDate(p.getStartElement());
183+
end = CdaFhirUtilities.getActualDate(p.getEndElement());
184+
185+
} else if (pi.hasEffective() && pi.getEffective() instanceof DateTimeType) {
186+
start = CdaFhirUtilities.getActualDate(pi.getEffective());
187+
}
188+
189+
sb.append(
190+
CdaGeneratorUtils.getXmlForIVLWithTS(
191+
CdaGeneratorConstants.EFF_TIME_EL_NAME, start, end, false));
192+
193+
String valXml = "";
194+
valXml = CdaFhirUtilities.getXmlForType(pi.getValue(), CdaGeneratorConstants.VAL_EL_NAME, true);
195+
196+
if (!valXml.isEmpty()) {
197+
sb.append(valXml);
198+
} else {
199+
sb.append(
200+
CdaGeneratorUtils.getXmlForNullValueEffectiveTime(
201+
CdaGeneratorConstants.VAL_EL_NAME, CdaGeneratorConstants.NF_NI));
202+
}
203+
204+
sb.append(CdaGeneratorUtils.getXmlForEndElement(CdaGeneratorConstants.OBS_ACT_EL_NAME));
205+
sb.append(CdaGeneratorUtils.getXmlForEndElement(CdaGeneratorConstants.ENTRY_EL_NAME));
206+
207+
pregObsXml.append(sb.toString());
208+
}
122209

123210
private static void processPregOutcomeObservation(
124211
Observation po,

0 commit comments

Comments
 (0)