Skip to content

Commit

Permalink
BS-224 | Mani, Siva, Vijay, David | Added dosage usage cdss alert mec…
Browse files Browse the repository at this point in the history
…hanism

Co-authored-by: Siva Reddy <[email protected]>
Co-authored-by: vijayanandtwks <[email protected]>
Co-authored-by: daviemukungi <[email protected]>
  • Loading branch information
4 people committed Oct 20, 2023
1 parent 335e007 commit 12e3aa8
Show file tree
Hide file tree
Showing 26 changed files with 1,719 additions and 108 deletions.
9 changes: 4 additions & 5 deletions Snomed_Substance_DDDs.tsv
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ B02BA01 phytomenadione 66656000 Phytomenadione (substance) 20 mg O NA
B02BA01 phytomenadione 66656000 Phytomenadione (substance) 20 mg P NA
B02BA02 menadione 412244007 Menadione (substance) 10 mg O NA
B02BA02 menadione 412244007 Menadione (substance) 2 mg P NA
B02BB01 fibrinogen, human 418326009 Human fibrinogen (substance) 5 g P NA
B02BB01 "fibrinogen, human" 418326009 Human fibrinogen (substance) 5 g P NA
B02BX04 romiplostim 439122000 Romiplostim (substance) 30 mcg P NA
B02BX05 eltrombopag 432005001 Eltrombopag (substance) 50 mg O NA
B02BX06 emicizumab 763611007 Emicizumab (substance) 15 mg P NA
Expand All @@ -396,7 +396,6 @@ B03XA03 methoxy polyethylene glycol-epoetin beta 425913002 Methoxy polyethylene
B06AC02 icatibant 703834005 Icatibant (substance) 30 mg P NA
B06AC04 conestat alfa 713468002 Conestat alfa (substance) 3.5 TU P NA
B06AC05 lanadelumab 773956002 Lanadelumab (substance) 21.4 mg P NA
B06AC05 lanadelumab 773956002 Lanadelumab (substance) NA NA NA NA
C01AA04 digitoxin 373534001 Digitoxin (substance) 0.1 mg O NA
C01AA04 digitoxin 373534001 Digitoxin (substance) 0.1 mg P NA
C01AA05 digoxin 387461009 Digoxin (substance) 0.25 mg O NA
Expand Down Expand Up @@ -719,7 +718,7 @@ G02AD03 gemeprost 395729005 Gemeprost (substance) 1 mg V Single dose treatment
G02AD04 carboprost 373455002 Carboprost (substance) 2.5 mg P Single dose treatment
G02AD05 sulprostone 713461008 Sulprostone (substance) 0.5 mg P NA
G02AD06 misoprostol 387242007 Misoprostol (substance) 0.2 mg O NA
G02AD06 misoprostol 387242007 Misoprostol (substance) 0.2 mg V vaginal insert, refers to the content of one vaginal insert
G02AD06 misoprostol 387242007 Misoprostol (substance) 0.2 mg V "vaginal insert, refers to the content of one vaginal insert"
G02CA01 ritodrine 372893009 Ritodrine (substance) 40 mg O NA
G02CA01 ritodrine 372893009 Ritodrine (substance) 40 mg P NA
G02CA02 buphenine 111140007 Nylidrin (substance) 30 mg P NA
Expand Down Expand Up @@ -749,11 +748,11 @@ G03CA03 estradiol 126172005 Estradiol (substance) 2 mg O NA
G03CA03 estradiol 126172005 Estradiol (substance) 1 mg P depot short duration
G03CA03 estradiol 126172005 Estradiol (substance) 0.3 mg P depot long duration
G03CA03 estradiol 126172005 Estradiol (substance) 5 mg R NA
G03CA03 estradiol 126172005 Estradiol (substance) 50 mcg TD patch, refer to amount delivered per 24 hours
G03CA03 estradiol 126172005 Estradiol (substance) 50 mcg TD "patch, refer to amount delivered per 24 hours"
G03CA03 estradiol 126172005 Estradiol (substance) 1 mg TD gel
G03CA03 estradiol 126172005 Estradiol (substance) 1.53 mg TD spray
G03CA03 estradiol 126172005 Estradiol (substance) 25 mcg V NA
G03CA03 estradiol 126172005 Estradiol (substance) 7.5 mcg V vaginal ring, refers to amount delivered per 24 hours
G03CA03 estradiol 126172005 Estradiol (substance) 7.5 mcg V "vaginal ring, refers to amount delivered per 24 hours"
G03CA04 estriol 73723004 Estriol (substance) 2 mg O NA
G03CA04 estriol 73723004 Estriol (substance) 2 mg P NA
G03CA04 estriol 73723004 Estriol (substance) 0.2 mg V NA
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
<artifactId>poi-ooxml</artifactId>
<version>5.2.3</version>
</dependency>
<dependency>
<groupId>net.steppschuh.markdowngenerator</groupId>
<artifactId>markdowngenerator</artifactId>
<version>1.3.1.1</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package org.snomed.cdsservice.model;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class AggregatedMedicationsBySubstance {
String substanceShortName;
List<String> medicationsList;

Map<String, DosageComparisonByRoute> dosageComparisonByRouteMap = new HashMap<>();
List<CDSReference> referenceList;

public AggregatedMedicationsBySubstance(String substanceShortName, List<String> medicationsList, List<CDSReference> referenceList) {
this.substanceShortName = substanceShortName;
this.medicationsList = medicationsList;
this.referenceList = referenceList;
}

public String getSubstanceShortName() {
return substanceShortName;
}

public void setSubstanceShortName(String substanceShortName) {
this.substanceShortName = substanceShortName;
}

public List<String> getMedicationsList() {
return medicationsList;
}

public void setMedicationsList(List<String> medicationsList) {
this.medicationsList = medicationsList;
}

public List<CDSReference> getReferenceList() {
return referenceList;
}

public void setReferenceList(List<CDSReference> referenceList) {
this.referenceList = referenceList;
}

public Map<String, DosageComparisonByRoute> getDosageComparisonByRouteMap() {
return dosageComparisonByRouteMap;
}

public void setDosageComparisonByRouteMap(Map<String, DosageComparisonByRoute> dosageComparisonByRouteMap) {
this.dosageComparisonByRouteMap = dosageComparisonByRouteMap;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.snomed.cdsservice.model;

import org.snomed.cdsservice.service.model.SubstanceDefinedDailyDose;

public class DosageComparisonByRoute {
PrescribedDailyDose totalPrescribedDailyDose;
SubstanceDefinedDailyDose substanceDefinedDailyDose;
String routeOfAdministration;

public DosageComparisonByRoute(PrescribedDailyDose totalPrescribedDailyDose, SubstanceDefinedDailyDose substanceDefinedDailyDose, String routeOfAdministration) {
this.totalPrescribedDailyDose = totalPrescribedDailyDose;
this.substanceDefinedDailyDose = substanceDefinedDailyDose;
this.routeOfAdministration = routeOfAdministration;
}

public PrescribedDailyDose getTotalPrescribedDailyDose() {
return totalPrescribedDailyDose;
}

public void setTotalPrescribedDailyDose(PrescribedDailyDose totalPrescribedDailyDose) {
this.totalPrescribedDailyDose = totalPrescribedDailyDose;
}

public SubstanceDefinedDailyDose getSubstanceDefinedDailyDose() {
return substanceDefinedDailyDose;
}

public void setSubstanceDefinedDailyDose(SubstanceDefinedDailyDose substanceDefinedDailyDose) {
this.substanceDefinedDailyDose = substanceDefinedDailyDose;
}

public String getRouteOfAdministration() {
return routeOfAdministration;
}

public void setRouteOfAdministration(String routeOfAdministration) {
this.routeOfAdministration = routeOfAdministration;
}
}
32 changes: 32 additions & 0 deletions src/main/java/org/snomed/cdsservice/model/PrescribedDailyDose.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package org.snomed.cdsservice.model;

public class PrescribedDailyDose {
Double quantity;
String unit;

public PrescribedDailyDose(Double quantity, String unit) {
this.quantity = quantity;
this.unit = unit;
}

public Double getQuantity() {
return quantity;
}

public void setQuantity(Double quantity) {
this.quantity = quantity;
}

public String getUnit() {
return unit;
}

public void setUnit(String unit) {
this.unit = unit;
}

public void addQuantity(Double newQuantity) {
this.quantity += newQuantity;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ public List<ManyToOneMapEntry> loadDoseFormMap() throws ServiceException {
String atcAdministrationCode = columns[0];
String snomedDoseFormQuery = columns[5];
int mapPriority = Integer.parseInt(columns[6]);
String routeOfAdministrationLabel = columns[1];
String valueSetURI = SnomedValueSetUtil.getSnomedECLValueSetURI(snomedDoseFormQuery);
try {
Set<String> manufacturedDoseFormSnomedCodes = tsClient.expandValueSet(valueSetURI).stream().map(Coding::getCode).collect(Collectors.toSet());
logger.info("Mapping {} SNOMED CT Manufactured dose forms to ATC route of administration '{}'.", manufacturedDoseFormSnomedCodes.size(), atcAdministrationCode);
mapEntries.add(new ManyToOneMapEntry(manufacturedDoseFormSnomedCodes, atcAdministrationCode, mapPriority));
mapEntries.add(new ManyToOneMapEntry(manufacturedDoseFormSnomedCodes, atcAdministrationCode, mapPriority, routeOfAdministrationLabel));
} catch (RestClientException e) {
throw new ServiceException(format("Failed to expand value set '%s'", valueSetURI), e);
}
Expand Down
Loading

0 comments on commit 12e3aa8

Please sign in to comment.