From d5d1ecc398898e5f296fa6315723df1a8aead8b9 Mon Sep 17 00:00:00 2001 From: "Choi, Myung" Date: Thu, 6 Apr 2017 00:59:03 -0400 Subject: [PATCH 1/4] fixed null crash when location and/or provider has id = 0 --- .../main/java/edu/gatech/i3l/fhir/dstu2/entities/Person.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Person.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Person.java index 4572fa2..f1639a6 100644 --- a/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Person.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Person.java @@ -325,7 +325,7 @@ public Patient getRelatedResource() { calendar.set(yob, mob-1, dob); patient.setBirthDate(new DateDt(calendar.getTime())); - if(this.location != null){ + if(this.location != null && this.location.getId() != 0L){ // PeriodDt period = new PeriodDt(); // period.setStart(new DateTimeDt(this.location.getStartDate())); // period.setEnd(new DateTimeDt(this.location.getEndDate())); @@ -352,7 +352,7 @@ public Patient getRelatedResource() { patient.setGender(admGender); } - if (this.provider != null) { + if (this.provider != null && this.provider.getId() != 0L) { ResourceReferenceDt practitionerResourceRef = new ResourceReferenceDt(this.provider.getIdDt()); practitionerResourceRef.setDisplay(this.provider.getProviderName()); List pracResourceRefs = new ArrayList(); From 9efba65cc0383b1f1fd3986d512eeb5db0d47885 Mon Sep 17 00:00:00 2001 From: "Choi, Myung" Date: Tue, 11 Apr 2017 16:14:29 -0400 Subject: [PATCH 2/4] disable OAuth as a default. --- gt-fhir-webapp/src/main/webapp/WEB-INF/fhir-server-config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gt-fhir-webapp/src/main/webapp/WEB-INF/fhir-server-config.xml b/gt-fhir-webapp/src/main/webapp/WEB-INF/fhir-server-config.xml index f36f27b..c2a58f9 100644 --- a/gt-fhir-webapp/src/main/webapp/WEB-INF/fhir-server-config.xml +++ b/gt-fhir-webapp/src/main/webapp/WEB-INF/fhir-server-config.xml @@ -38,7 +38,7 @@ - + From 17127d59a17dfd403e559ee148d9d7b574f6b6bd Mon Sep 17 00:00:00 2001 From: "Choi, Myung" Date: Sun, 16 Apr 2017 23:59:13 -0400 Subject: [PATCH 3/4] Get source value or value source value if concept is 0 or value is 0 --- .../i3l/fhir/dstu2/entities/Observation.java | 22 +++++++++++++++++-- .../WEB-INF/fhir-server-database-config.xml | 6 ++--- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Observation.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Observation.java index 0dea09a..dbd9be4 100644 --- a/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Observation.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Observation.java @@ -125,6 +125,9 @@ public class Observation extends BaseResourceEntity { @Column(name = "source_value") private String sourceValue; + @Column(name = "value_source_value") + private String valueSourceValue; + @ManyToOne(cascade = { CascadeType.MERGE }, fetch = FetchType.LAZY) @JoinColumn(name = "unit_concept_id") private Concept unit; @@ -293,6 +296,14 @@ public String getUnitSourceValue() { public void setUnitSourceValue(String unitSourceValue) { this.unitSourceValue = unitSourceValue; } + + public String getValueSourceValue() { + return valueSourceValue; + } + + public void setValueSourceValue(String valueSourceValue) { + this.valueSourceValue = valueSourceValue; + } @Override public IResourceEntity constructEntityFromResource(IResource resource) { @@ -401,7 +412,12 @@ public IResource getRelatedResource() { String systemUriString = this.observationConcept.getVocabulary().getSystemUri(); String codeString = this.observationConcept.getConceptCode(); - String displayString = this.observationConcept.getName(); + String displayString; + if (this.observationConcept.getId() == 0L) { + displayString = this.getSourceValue(); + } else { + displayString = this.observationConcept.getName(); + } // OMOP database maintains Systolic and Diastolic Blood Pressures separately. // FHIR however keeps them together. Observation DAO filters out Diastolic values. @@ -491,11 +507,13 @@ public IResource getRelatedResource() { value = quantity; } else if (this.valueAsString != null) { value = new StringDt(this.valueAsString); - } else if (this.valueAsConcept != null) { + } else if (this.valueAsConcept != null && this.valueAsConcept.getId() != 0L) { // vocabulary is a required attribute for concept, then it's expected to not be null CodeableConceptDt valueAsConcept = new CodeableConceptDt(this.valueAsConcept.getVocabulary().getSystemUri(), this.valueAsConcept.getConceptCode()); value = valueAsConcept; + } else { + value = new StringDt(this.getValueSourceValue()); } observation.setValue(value); } diff --git a/gt-fhir-webapp/src/main/webapp/WEB-INF/fhir-server-database-config.xml b/gt-fhir-webapp/src/main/webapp/WEB-INF/fhir-server-database-config.xml index ca5e967..4e68965 100644 --- a/gt-fhir-webapp/src/main/webapp/WEB-INF/fhir-server-database-config.xml +++ b/gt-fhir-webapp/src/main/webapp/WEB-INF/fhir-server-database-config.xml @@ -23,10 +23,10 @@ - + - - + + - - + - - + +