Skip to content

Commit

Permalink
Merge pull request #917 from Shreeja-dev/745-csv-validate-new
Browse files Browse the repository at this point in the history
745 csv validate new
  • Loading branch information
ratheesh-kr authored Dec 19, 2024
2 parents 3ab9c26 + 7e55771 commit f1b2c7c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,24 @@ private static void populateOrganizationIdentifier(Organization organization, Qe
if (StringUtils.isNotEmpty(data.getFacilityId())) {
Identifier identifier = new Identifier();
Coding coding = new Coding();
coding.setDisplay("Care Ridge"); //Static_Value

if (StringUtils.isNotEmpty(data.getFacilityIdentifierTypeDisplay())) {
coding.setDisplay(data.getFacilityIdentifierTypeDisplay());
LOG.info("Coding Display Set: {}", data.getFacilityIdentifierTypeDisplay());
}

if (StringUtils.isNotEmpty(data.getFacilityIdentifierTypeValue())) {
identifier.setValue(data.getFacilityIdentifierTypeValue());
LOG.info("Identifier Value Set: {}", data.getFacilityIdentifierTypeValue());
}

CodeableConcept type = new CodeableConcept();
type.addCoding(coding);
identifier.setType(type);
identifier.setValue(data.getFacilityName());
identifier.setSystem("http://www.scn.ny.gov/");
LOG.info("Adding Identifier: Type Display - {}, Value - {}",
coding.getDisplay(), identifier.getValue());

organization.addIdentifier(identifier);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public List<BundleEntryComponent> convert(Bundle bundle, DemographicData demogra
// screening records
patient.setLanguage("en");
populatePatientWithExtensions(patient, demographicData);
populateMrIdentifier(patient, demographicData,idsGenerated );
populateMrIdentifier(patient, demographicData,qeAdminData, idsGenerated );
populateMaIdentifier(patient, demographicData);
populateSsnIdentifier(patient, demographicData);
populatePatientName(patient, demographicData);
Expand Down Expand Up @@ -109,7 +109,7 @@ public static void populatePatientWithExtensions(Patient patient,DemographicData
Extension raceExtension = new Extension("http://hl7.org/fhir/us/core/StructureDefinition/us-core-race");
Extension ombCategoryExtension = new Extension("ombCategory");
ombCategoryExtension.setValue(new Coding()
.setSystem("urn:oid:2.16.840.1.113883.6.238")
.setSystem(demographicData.getExtensionOmbCategoryRaceCodeSystemName())
.setCode(demographicData.getExtensionOmbCategoryRaceCode())
.setDisplay(demographicData.getExtensionOmbCategoryRaceCodeDescription()));
raceExtension.addExtension(ombCategoryExtension);
Expand All @@ -125,7 +125,7 @@ public static void populatePatientWithExtensions(Patient patient,DemographicData

Extension ombCategoryExtension = new Extension("ombCategory");
ombCategoryExtension.setValue(new Coding()
.setSystem("urn:oid:2.16.840.1.113883.6.238")
.setSystem(demographicData.getExtensionOmbCategoryEthnicityCodeSystemName())
.setCode(demographicData.getExtensionOmbCategoryEthnicityCode())
.setDisplay(demographicData.getExtensionOmbCategoryEthnicityCodeDescription()));
ethnicityExtension.addExtension(ombCategoryExtension);
Expand All @@ -139,7 +139,7 @@ public static void populatePatientWithExtensions(Patient patient,DemographicData

if (demographicData.getExtensionSexAtBirthCodeValue() != null) {
Extension birthSexExtension = new Extension("http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex");
birthSexExtension.setValue(new org.hl7.fhir.r4.model.CodeType(demographicData.getExtensionSexAtBirthCodeValue()));
birthSexExtension.setValue(new StringType(demographicData.getExtensionSexAtBirthCodeValue()));
patient.addExtension(birthSexExtension);
}

Expand Down Expand Up @@ -177,8 +177,6 @@ private static Patient populatePatientName(Patient patient, DemographicData demo
if (demographicData.getFamilyName() != null) {
name.setFamily(demographicData.getFamilyName());
}
name.addPrefix("Mr., Dr., PhD, CCNA"); // TODO : remove static reference
name.addSuffix("Jr., III"); // TODO : remove static reference
patient.addName(name);
return patient;
}
Expand All @@ -205,7 +203,7 @@ private String generateUniqueId(String encounterId, String facilityId, String pa



private static void populateMrIdentifier(Patient patient, DemographicData data,Map<String,String> idsGenerated) {
private static void populateMrIdentifier(Patient patient, DemographicData data,QeAdminData qeAdminData,Map<String,String> idsGenerated) {
if (StringUtils.isNotEmpty(data.getPatientMrIdValue())) {
Identifier identifier = new Identifier();
Coding coding = new Coding();
Expand All @@ -214,7 +212,7 @@ private static void populateMrIdentifier(Patient patient, DemographicData data,M
CodeableConcept type = new CodeableConcept();
type.addCoding(coding);
identifier.setType(type);
identifier.setSystem("http://www.scn.gov/facility/CUMC"); // TODO : remove static reference
identifier.setSystem("http://www.scn.gov/facility/"+qeAdminData.getFacilityId());
identifier.setValue(data.getPatientMrIdValue());

// Optional: Add assigner if needed (uncomment if required)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public List<BundleEntryComponent> convert(
Observation observation = new Observation();
String observationId = CsvConversionUtil.sha256(data.getEncounterId()+data.getScreeningCode()); // Use screening code as ID'
observation.setId(observationId);
String fullUrl = "http://shinny.org/us/ny/hrsn/Observation/" + data.getQuestionCode();
String fullUrl = "http://shinny.org/us/ny/hrsn/Observation/%s%s"
.formatted(data.getQuestionCodeDisplay().replace(" ", ""), data.getQuestionCode());
setMeta(observation);
Meta meta = observation.getMeta();
meta.setLastUpdated(DateUtil.parseDate(demographicData.getPatientLastUpdated())); // max date available in all
Expand Down

0 comments on commit f1b2c7c

Please sign in to comment.