Skip to content

Commit

Permalink
Refill date fix (#89)
Browse files Browse the repository at this point in the history
* Fix

* Medication refill fixes

* small fix
  • Loading branch information
pmanko authored Mar 23, 2022
1 parent 079031d commit 47eddb7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ public String parseCcdToHtml(Bundle resource, File ccdTemplate) throws IOExcepti
List<AllergyIntolerance> intolerances = new ArrayList<>();
// process the resource entries individually and push them to the template

Date nextRefill = null;

for (Bundle.BundleEntryComponent bundleEntry : entry) {
Resource eResource = bundleEntry.getResource();
switch (eResource.getResourceType().name()) {
Expand Down Expand Up @@ -128,9 +130,18 @@ public String parseCcdToHtml(Bundle resource, File ccdTemplate) throws IOExcepti
case "163711AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": {
// Current Medication Dispensed Construct
Medication medication = mapMedicationList(obs);
if(nextRefill != null) medication.setNextRefill(nextRefill);
medications.add(medication);
break;
}
case "162549AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": {
// process Date medication refills due
for (int i = 0; i < medications.size(); i++) {
medications.get(i).setNextRefill(obs.getValueDateTimeType().getValue());
}
break;
}

}

}
Expand Down Expand Up @@ -324,11 +335,6 @@ private Medication mapMedicationList(Observation obs) {
medication.setIndications(memberResource.getValueCodeableConcept().getCodingFirstRep().getDisplay());
break;
}
case "162549AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA": {
// process Date medication refills due
medication.setNextRefill(memberResource.getValueDateTimeType().getValue());
break;
}
}


Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/ccdTemplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@
<div>
<div class="head">
<table>
<thead>medications
<thead>
<tr>
<th>Medication</th>
<th>Dispense Date</th>
Expand Down

0 comments on commit 47eddb7

Please sign in to comment.