Skip to content

Commit

Permalink
STU 1.3 Update
Browse files Browse the repository at this point in the history
Changing packaging name from <packageversion>-<fhirversion>-<ig_version> to simpler: <packageversion>-<ig_version>. Updated resources to match VRDR_IG version 1.3. Updating examples in test/ folder
  • Loading branch information
MikeRileyGTRI committed Mar 11, 2022
1 parent d939525 commit 3369c00
Show file tree
Hide file tree
Showing 15 changed files with 383 additions and 194 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

target/*
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.hl7.fhir.r4.model.CodeableConcept;
import org.hl7.fhir.r4.model.DateTimeType;
import org.hl7.fhir.r4.model.Observation;
import org.hl7.fhir.r4.model.Reference;
import org.hl7.fhir.r4.model.StringType;

import ca.uhn.fhir.model.api.annotation.ResourceDef;
Expand All @@ -17,17 +18,22 @@ public BirthRecordIdentifier() {
CommonUtil.initResource(this);
}

public BirthRecordIdentifier(String value, CodeableConcept birthState,
public BirthRecordIdentifier(String value, Decedent decedent, CodeableConcept birthJurisdiction,
DateTimeType birthYear) {
this();
setStatus(BirthRecordIdentifierUtil.status);
setCode(BirthRecordIdentifierUtil.code);
setDecedent(decedent);
setValue(new StringType(value));
addBirthState(birthState);
addBirthState(birthJurisdiction);
addBirthYear(birthYear);
}

public CodeableConcept getBirthState() {
public void setDecedent(Decedent decedent) {
Reference reference = new Reference(decedent);
this.setSubject(reference);
}
public CodeableConcept getBirthJurisdiction() {
for (ObservationComponentComponent component : getComponent()) {
if (component.getCode().equalsShallow(BirthRecordIdentifierUtil.componentBirthStateCode)) {
return component.getValueCodeableConcept();
Expand All @@ -36,7 +42,7 @@ public CodeableConcept getBirthState() {
return null;
}

public void setBirthState(CodeableConcept birthState) {
public void setBirthJurisdiction(CodeableConcept birthState) {
for (ObservationComponentComponent component : getComponent()) {
if (component.getCode().equalsShallow(BirthRecordIdentifierUtil.componentBirthStateCode)) {
component.setValue(birthState);
Expand Down
83 changes: 62 additions & 21 deletions src/main/java/edu/gatech/chai/VRDR/model/CauseOfDeathCondition.java
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
package edu.gatech.chai.VRDR.model;

import java.util.List;

import org.hl7.fhir.r4.model.CodeableConcept;
import org.hl7.fhir.r4.model.Condition;
import org.hl7.fhir.r4.model.Observation;
import org.hl7.fhir.r4.model.Quantity;
import org.hl7.fhir.r4.model.Reference;
import org.hl7.fhir.r4.model.StringType;

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

@ResourceDef(name = "Condition", profile = "http://hl7.org/fhir/us/vrdr/StructureDefinition/VRDR-Cause-Of-Death-Condition")
public class CauseOfDeathCondition extends Condition {
//NOTE: While the resource name is "CauseOfDeathCondition", it actually derived from Observation
@ResourceDef(name = "Observation", profile = "http://hl7.org/fhir/us/vrdr/StructureDefinition/VRDR-Cause-Of-Death-Condition")
public class CauseOfDeathCondition extends Observation {
public CauseOfDeathCondition() {
super();
CommonUtil.initResource(this);
this.addCategory(CauseOfDeathConditionUtil.causeOfDeathConditionCategory);
this.setCode(CauseOfDeathConditionUtil.code);
}

public CauseOfDeathCondition(Decedent decedent) {
public CauseOfDeathCondition(Decedent decedent, Certifier certifier, String value, Quantity interval) {
super();
CommonUtil.initResource(this);
this.addCategory(CauseOfDeathConditionUtil.causeOfDeathConditionCategory);
this.setCode(CauseOfDeathConditionUtil.code);
setDecedent(decedent);
setPerformer(certifier);
setValue(value);
createInterval(interval);
}

public CauseOfDeathCondition(Decedent decedent, Certifier certifier, String value, String interval) {
super();
CommonUtil.initResource(this);
this.setCode(CauseOfDeathConditionUtil.code);
setDecedent(decedent);
setPerformer(certifier);
setValue(value);
createInterval(interval);
}

public void setDecedent(Decedent decedent) {
Expand All @@ -38,32 +57,54 @@ public Reference getDecedent() {

public void setCertifier(Certifier certifier) {
Reference reference = new Reference(certifier.getId());
this.asserter = reference;
this.performer.add(reference);
}
public void setAsserter(Certifier certifier) {
setCertifier(certifier);
}
public void setPerformer(Certifier certifier) {
setCertifier(certifier);
}

public Reference getCertifier() {
return asserter;
public List<Reference> getCertifiers(int index) {
return performer;
}

public Condition setClinicalStatus(String clinicalStatus) {
CodeableConcept clinicalStatusCC = CommonUtil.findConceptFromCollectionUsingSimpleString(clinicalStatus, CauseOfDeathConditionUtil.conditionClinicalStatusSet);
this.setClinicalStatus(clinicalStatusCC);
return this;
public List<Reference> getAsserters(int index) {
return performer;
}

public Condition setVerificationStatus(String verificationStatus) {
CodeableConcept verificationStatusCC = CommonUtil.findConceptFromCollectionUsingSimpleString(verificationStatus, CauseOfDeathConditionUtil.verificationStatusSet);
this.setVerificationStatus(verificationStatusCC);
return this;
public List<Reference> getPerformers(int index) {
return performer;
}

/*public Condition setCategory(String category) {
CodeableConcept categoryCC = CommonUtil.findConceptFromCollectionUsingSimpleString(category, CauseOfDeathConditionUtil.categorySet);
this.setVerificationStatus(categoryCC);
return this;
}*/
public Reference getCertifier(int index) {
return performer.get(index);
}

public void setValue(StringType value) {
if((value.getValue().length() > 120)) {
throw new IllegalArgumentException("CauseOfDeathCondition value "+value.getValue()+" is too long, must be 120 characters or less.");
}
this.setValue(value);
}

public void setValue(String value) {
setValue(new StringType(value));
}

public void createInterval(Quantity quantity) {
ObservationComponentComponent component = new ObservationComponentComponent();
component.setCode(CauseOfDeathConditionUtil.intervalComponentCode);
component.setValue(quantity);

}

public void createInterval(String string) {
ObservationComponentComponent component = new ObservationComponentComponent();
component.setCode(CauseOfDeathConditionUtil.intervalComponentCode);
component.setValue(new StringType(string));

}

}
Original file line number Diff line number Diff line change
@@ -1,41 +1,34 @@
package edu.gatech.chai.VRDR.model;

import java.util.List;

import org.hl7.fhir.r4.model.Condition;
import org.hl7.fhir.r4.model.Observation;
import org.hl7.fhir.r4.model.Quantity;
import org.hl7.fhir.r4.model.Reference;
import org.hl7.fhir.r4.model.StringType;
import org.hl7.fhir.r4.model.Observation.ObservationComponentComponent;

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

@ResourceDef(name = "Condition", profile = "http://hl7.org/fhir/us/vrdr/StructureDefinition/VRDR-Condition-Contributing-To-Death")
public class ConditionContributingToDeath extends Condition {
@ResourceDef(name = "Observation", profile = "http://hl7.org/fhir/us/vrdr/StructureDefinition/VRDR-Condition-Contributing-To-Death")
public class ConditionContributingToDeath extends Observation {
public ConditionContributingToDeath() {
super();
CommonUtil.initResource(this);
this.addCategory(ConditionContributingToDeathUtil.conditionContributingToDeathCategory);
}

public ConditionContributingToDeath(Decedent decedent) {
super();
CommonUtil.initResource(this);
this.addCategory(CauseOfDeathConditionUtil.causeOfDeathConditionCategory);
setDecedent(decedent);
}

public ConditionContributingToDeath(Certifier certifier) {
super();
CommonUtil.initResource(this);
this.addCategory(CauseOfDeathConditionUtil.causeOfDeathConditionCategory);
setCertifier(certifier);
this.setCode(ConditionContributingToDeathUtil.code);
}

public ConditionContributingToDeath(Decedent decedent, Certifier certifier) {
public ConditionContributingToDeath(Decedent decedent, Certifier certifier, String value) {
super();
CommonUtil.initResource(this);
this.setCode(ConditionContributingToDeathUtil.code);
setDecedent(decedent);
this.addCategory(CauseOfDeathConditionUtil.causeOfDeathConditionCategory);
setCertifier(certifier);
setPerformer(certifier);
setValue(value);
}

public void setDecedent(Decedent decedent) {
Expand All @@ -53,13 +46,39 @@ public Reference getDecedent() {

public void setCertifier(Certifier certifier) {
Reference reference = new Reference(certifier.getId());
this.asserter = reference;
this.performer.add(reference);
}
public void setAsserter(Certifier certifier) {
setCertifier(certifier);
}
public void setPerformer(Certifier certifier) {
setCertifier(certifier);
}

public List<Reference> getCertifiers(int index) {
return performer;
}

public List<Reference> getAsserters(int index) {
return performer;
}

public List<Reference> getPerformers(int index) {
return performer;
}

public Reference getCertifier(int index) {
return performer.get(index);
}

public void setValue(StringType value) {
if((value.getValue().length() > 240)) {
throw new IllegalArgumentException("CauseOfDeathCondition value "+value.getValue()+" is too long, must be 240 characters or less.");
}
this.setValue(value);
}

public Reference getCertifier() {
return asserter;
public void setValue(String value) {
setValue(new StringType(value));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
import java.util.stream.Collectors;

import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Extension;
import org.hl7.fhir.r4.model.Resource;
import org.hl7.fhir.r4.model.StringType;

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

@ResourceDef(name = "Bundle", profile = "http://hl7.org/fhir/us/vrdr/StructureDefinition/VRDR-Death-Certificate-Document")
public class DeathCertificateDocument extends Bundle {
Expand All @@ -19,6 +22,13 @@ public DeathCertificateDocument() {
setType(BundleType.DOCUMENT);
}

public void addAuxillaryStateIdentifier(String auxillaryStateIdentifierValue) {
Extension extension = new Extension();
extension.setUrl(DeathCertificateDocumentUtil.auxillaryStateIndentifierUrl);
extension.setValue(new StringType(auxillaryStateIdentifierValue));
this.getIdentifier().addExtension(extension);
}

//Helper Accessor methods

private List<Resource> getRecords(Class<? extends Resource> type){
Expand Down
16 changes: 2 additions & 14 deletions src/main/java/edu/gatech/chai/VRDR/model/DeathLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,21 @@ public DeathLocation() {
super();
CommonUtil.initResource(this);
}
public DeathLocation(String name, String jurisdicitionId, String description, CodeableConcept type, Address address,
CodeableConcept physicalType) {
public DeathLocation(String name, String description, CodeableConcept type, Address address) {
this();
setName(name);
addJurisdictionIdExtension(jurisdicitionId);
setDescription(description);
addType(type);
setAddress(address);
setPhysicalType(physicalType);
}

public DeathLocation(String name, String jurisdicitionId, String description, String type, Address address,
CodeableConcept physicalType) {
public DeathLocation(String name, String description, String type, Address address) {
this();
CodeableConcept typeCC = CommonUtil.findConceptFromCollectionUsingSimpleString(type, DeathLocationUtil.placeOfDeathTypeSet);
setName(name);
addJurisdictionIdExtension(jurisdicitionId);
setDescription(description);
addType(typeCC);
setAddress(address);
setPhysicalType(physicalType);
}

public DeathLocation addJurisdictionIdExtension(String jurisdicitionId) {
Extension extension = new Extension(DeathLocationUtil.locationJurisdictionIdExtension);
extension.setValue(CommonUtil.findConceptFromCollectionUsingSimpleString(jurisdicitionId, CommonUtil.locationJurisdictionalConceptSet));
this.addExtension(extension);
return this;
}
}
Loading

0 comments on commit 3369c00

Please sign in to comment.