Skip to content

Commit

Permalink
Major revision update to model to reflect correct system uris. Update…
Browse files Browse the repository at this point in the history
…d BuildDCD test.
  • Loading branch information
MikeRileyGTRI committed Apr 2, 2020
1 parent 8e91cac commit 7717241
Show file tree
Hide file tree
Showing 72 changed files with 6,523 additions and 320 deletions.
14 changes: 12 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>edu.gatech</groupId>
<artifactId>VRDR</artifactId>
<version>v0.1.0-STUBallot1-REVISED</version>
<version>v0.1.0-STUBallot1-REVISED.1</version>
<packaging>jar</packaging>

<name>VRDR</name>
Expand All @@ -14,7 +14,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<fhir.version>3.8.0</fhir.version>
<fhir.version>4.1.0</fhir.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -44,5 +44,15 @@
<artifactId>hapi-fhir-structures-dstu3</artifactId>
<version>${fhir.version}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation</artifactId>
<version>${fhir.version}</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
<version>${fhir.version}</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.hl7.fhir.dstu3.model.CodeableConcept;
import org.hl7.fhir.dstu3.model.DateTimeType;
import org.hl7.fhir.dstu3.model.Observation;
import org.hl7.fhir.dstu3.model.Reference;
import org.hl7.fhir.dstu3.model.StringType;

import ca.uhn.fhir.model.api.annotation.ResourceDef;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/edu/gatech/VRDR/model/Certifier.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.hl7.fhir.dstu3.model.Practitioner;

import ca.uhn.fhir.model.api.annotation.ResourceDef;
import edu.gatech.VRDR.model.util.CertifierUtil;
import edu.gatech.VRDR.model.util.CommonUtil;

@ResourceDef(name = "Practitioner", profile = "http://hl7.org/fhir/us/vrdr/StructureDefinition/VRDR-Certifier")
Expand All @@ -17,11 +16,12 @@ public Certifier() {
CommonUtil.initResource(this);
}

public PractitionerQualificationComponent addQualification(String identifier, String type) {
public PractitionerQualificationComponent addQualification(String identifier, String type,String title) {
CodeableConcept identifierTypeCodeableConcept = CommonUtil.findConceptFromCollectionUsingSimpleString(type, CommonUtil.deathReportingIdentifierTypeCodes);
PractitionerQualificationComponent component = new PractitionerQualificationComponent(identifierTypeCodeableConcept);
component.setCode(new CodeableConcept().addCoding(new Coding("http://www.hl7.org/fhir/v2/0360/2.7",title,"")));
component.addIdentifier(new Identifier().setValue(identifier));
addQualification(component);
return component;
}
}
}
1 change: 1 addition & 0 deletions src/main/java/edu/gatech/VRDR/model/Decedent.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,5 @@ public Identifier addIdentifier(String value) {
addIdentifier(identifier);
return identifier;
}
//TODO: Add handler for informant mapping
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import org.hl7.fhir.dstu3.model.CodeableConcept;
import org.hl7.fhir.dstu3.model.Observation;
import org.hl7.fhir.dstu3.model.Observation.ObservationComponentComponent;

import ca.uhn.fhir.model.api.annotation.ResourceDef;
import edu.gatech.VRDR.model.util.CommonUtil;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/edu/gatech/VRDR/model/DecedentPregnancy.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import ca.uhn.fhir.model.api.annotation.ResourceDef;
import edu.gatech.VRDR.model.util.CommonUtil;
import edu.gatech.VRDR.model.util.DecedentPregnancyUtil;
import edu.gatech.VRDR.model.util.TobaccoUseContributedToDeathUtil;

@ResourceDef(name = "Observation", profile = "http://hl7.org/fhir/us/StructureDefinition/VRDR-Decedent-Pregnancy")
public class DecedentPregnancy extends Observation {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/edu/gatech/VRDR/model/ExaminerContacted.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
public class ExaminerContacted extends Observation {
public ExaminerContacted() {
super();
setStatus(ExaminerContactedUtil.status);
setCode(ExaminerContactedUtil.code);
CommonUtil.initResource(this);
}
public ExaminerContacted(boolean value) {
this();
setStatus(ExaminerContactedUtil.status);
setCode(ExaminerContactedUtil.code);
setValue(new BooleanType(value));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import org.hl7.fhir.dstu3.model.PractitionerRole;

import ca.uhn.fhir.model.api.annotation.ResourceDef;
import edu.gatech.VRDR.model.util.CommonUtil;

@ResourceDef(name = "PractitionerRole", profile = "http://hl7.org/fhir/us/vrdr/StructureDefinition/VRDR_FuneralServiceLicensee")
public class FuneralServiceLicensee extends PractitionerRole {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package edu.gatech.VRDR.model;

import org.hl7.fhir.dstu3.model.BooleanType;
import org.hl7.fhir.dstu3.model.CodeableConcept;
import org.hl7.fhir.dstu3.model.Coding;
import org.hl7.fhir.dstu3.model.Observation;

import ca.uhn.fhir.model.api.annotation.ResourceDef;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/edu/gatech/VRDR/model/util/CommonUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.CodeableConcept;
import org.hl7.fhir.dstu3.model.Coding;
import org.hl7.fhir.dstu3.model.Composition.SectionComponent;
import org.hl7.fhir.dstu3.model.DomainResource;
import org.hl7.fhir.dstu3.model.Extension;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.Reference;
import org.hl7.fhir.dstu3.model.Resource;
import org.hl7.fhir.dstu3.model.Composition.SectionComponent;

import edu.gatech.VRDR.model.DeathCertificate;
import edu.gatech.VRDR.model.DeathCertificateDocument;

public class CommonUtil {
public static String basicBooleanHL7System = "http://terminology.www.hl7.org/CodeSystem/v2-0136";
public static String basicBooleanHL7System = "http://hl7.org/CodeSystem/v2-0136";
public static String nullFlavorHL7System = "http://hl7.org/fhir/v3/NullFlavor";
public static CodeableConcept noCode = new CodeableConcept().addCoding(new Coding(basicBooleanHL7System,"N","No"));
public static CodeableConcept yesCode = new CodeableConcept().addCoding(new Coding(basicBooleanHL7System,"Y","Yes"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public class DeathCertificationUtil {
public static final CodeableConcept categoryFixedValue = new CodeableConcept()
.addCoding(new Coding().setCode("103693007"));
.addCoding(new Coding().setCode("103693007").setSystem("http://snomed.info/sct"));
public static final CodeableConcept codeFixedValue = new CodeableConcept()
.addCoding(new Coding().setCode("308646001"));
}
2 changes: 1 addition & 1 deletion src/main/java/edu/gatech/VRDR/model/util/DecedentUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class DecedentUtil {
public static final String birthSexExtensionURL = "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex";
public static final String birthSexValueSetURL = "http://hl7.org/fhir/us/core/ValueSet/us-core-birthsex";
public static final String birthPlaceExtensionURL = "http://hl7.org/fhir/StructureDefinition/birthPlace";
public static final String addressWithCityLimitsIndicatorExtensionURL = "http://hl7.org/fhir/us/vrdr/StructureDefinition/Within-City-Limits-Indicator";
public static final String addressWithinCityLimitsIndicatorExtensionURL = "http://hl7.org/fhir/us/vrdr/StructureDefinition/Within-City-Limits-Indicator";
public static final CodeableConcept identifierTypeFixedValue = new CodeableConcept()
.addCoding(new Coding().setCode("BR").setDisplay("Social Beneficiary Identifier"));
public static final String identifierSystem = "urn:oid:2.16.840.1.113883.4.1";
Expand Down
51 changes: 51 additions & 0 deletions src/main/java/edu/gatech/VRDR/util/HumanNameParser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package edu.gatech.VRDR.util;

import java.util.Arrays;
import java.util.StringJoiner;

import org.hl7.fhir.dstu3.model.HumanName;

public class HumanNameParser {
private static final String[] prefixList = {"Mr.", "Mrs.", "Ms.", "Dr.", "Adm", "Capt", "Chief", "Gen", "Gov", "Hon", "Maj", "Prof", "Rabbi", "Rev", "Sister"};
private static final String[] suffixList = {"II", "III", "IV", "CPA", "DDS", "Esq", "Jr", "LLD", "MD", "PhD", "Ret", "Sr", "DO"};
public static HumanName createHumanName(String nameString) {
HumanName returnName = new HumanName();
String[] nameParts = nameString.split("\\s+");
if(nameParts.length == 1) {
returnName.addGiven(nameParts[0]);
return returnName;
}
if(nameParts.length == 2) {
returnName.addGiven(nameParts[0]);
returnName.setFamily(nameParts[1]);
return returnName;
}

boolean hasPrefix = false;
boolean hasSuffix = false;
int familyIndex = nameParts.length-1;
int givenStartIndex = 0;
if(Arrays.asList(prefixList).contains(nameParts[0])) {
returnName.addPrefix(nameParts[0]);
givenStartIndex = 1;
}
if(Arrays.asList(suffixList).contains(nameParts[nameParts.length-1])) {
returnName.addSuffix(nameParts[nameParts.length-1]);
familyIndex = nameParts.length-2;
}
String familyName = "";
String givenName = "";
if(hasSuffix) {
familyIndex = nameParts.length - 2;
}
StringJoiner joiner = new StringJoiner(" ");
for(int i = givenStartIndex; i < familyIndex; i++) {
joiner.add(nameParts[i]);
}
givenName = joiner.toString();
familyName = nameParts[familyIndex];
returnName.addGiven(givenName);
returnName.setFamily(familyName);
return returnName;
}
}
Loading

0 comments on commit 7717241

Please sign in to comment.