diff --git a/.gitignore b/.gitignore index a35307e..0e67d43 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,149 @@ +/bin +/target +target/ +.idea/ +.project/ +.settings/ +.metadata/ +RemoteSystemsTempFiles/ +Servers/ +*.iml +*.log +*.log* +nohup.out +.DS_Store +*.orig + +# Vagrant stuff. +.vagrant +/vagrant/build +/vagrant/chef/tmp + + + +# Created by https://www.gitignore.io + +### Java ### +*.class + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties + + +### Vim ### +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +*.un~ +Session.vim +.netrwhist +*~ + + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm + +*.iml + +## Directory-based project format: +.idea/ +# if you remove the above rule, at least ignore the following: + +# User-specific stuff: +# .idea/workspace.xml +# .idea/tasks.xml +# .idea/dictionaries + +# Sensitive or high-churn files: +# .idea/dataSources.ids +# .idea/dataSources.xml +# .idea/sqlDataSources.xml +# .idea/dynamic.xml +# .idea/uiDesigner.xml + +# Gradle: +# .idea/gradle.xml +# .idea/libraries + +# Mongo Explorer plugin: +# .idea/mongoSettings.xml + +## File-based project format: +*.ipr +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties + + +### Eclipse ### +*.pydevproject +.metadata +.gradle +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath + +# Eclipse Core +.project + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# PDT-specific +.buildpath + +# sbteclipse plugin +.target + +# TeXlipse plugin +.texlipse + # Local configuration files -gt-fhir-webapp/src/main/webapp/WEB-INF/hapi-fhir-server-database-config.xml - -# Other dependent source packages -examples -hapi-deployable-pom -hapi-fhir-android -hapi-fhir-base -hapi-fhir-dist -hapi-fhir-jpaserver-base -hapi-fhir-jpaserver-example -hapi-fhir-jpaserver-uhnfhirtest -hapi-fhir-oauth2 -hapi-fhir-structures-dev -hapi-fhir-structures-dstu -hapi-fhir-structures-dstu2 -hapi-fhir-structures-hl7org-dstu2 -hapi-fhir-testpage-interceptor -hapi-fhir-testpage-overlay -hapi-fhir-tutorial -hapi-tinder-test -hapi-tinder-plugin -restful-server-example -restful-server-example-test -temp -vagrant +gt-fhir-webapp/src/main/webapp/WEB-INF/hapi-fhir-server-database-config.xml \ No newline at end of file diff --git a/gt-fhir-entities/.classpath b/gt-fhir-entities/.classpath new file mode 100644 index 0000000..e1d24bc --- /dev/null +++ b/gt-fhir-entities/.classpath @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gt-fhir-entities/.project b/gt-fhir-entities/.project new file mode 100644 index 0000000..6dd4481 --- /dev/null +++ b/gt-fhir-entities/.project @@ -0,0 +1,36 @@ + + + gt-fhir-entities + + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + org.eclipse.wst.common.project.facet.core.nature + + diff --git a/gt-fhir-entities/.settings/org.eclipse.jdt.core.prefs b/gt-fhir-entities/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..13b3428 --- /dev/null +++ b/gt-fhir-entities/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,13 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/gt-fhir-entities/.settings/org.eclipse.m2e.core.prefs b/gt-fhir-entities/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 0000000..f897a7f --- /dev/null +++ b/gt-fhir-entities/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/gt-fhir-entities/.settings/org.eclipse.wst.common.component b/gt-fhir-entities/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..ba8b42e --- /dev/null +++ b/gt-fhir-entities/.settings/org.eclipse.wst.common.component @@ -0,0 +1,6 @@ + + + + + + diff --git a/gt-fhir-entities/.settings/org.eclipse.wst.common.project.facet.core.xml b/gt-fhir-entities/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..f4bf050 --- /dev/null +++ b/gt-fhir-entities/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/gt-fhir-entities/pom.xml b/gt-fhir-entities/pom.xml new file mode 100644 index 0000000..6bcbb67 --- /dev/null +++ b/gt-fhir-entities/pom.xml @@ -0,0 +1,61 @@ + + 4.0.0 + edu.gatech.i3l + gt-fhir-entities + 1.0 + + + oss-snapshots + + true + + https://oss.sonatype.org/content/repositories/snapshots/ + + + + false + + central + libs-release + http://leo.i3l.gatech.edu:8081/artifactory/libs-release + + + + snapshots + libs-snapshot + http://leo.i3l.gatech.edu:8081/artifactory/libs-snapshot + + + + 4.2.17.Final + + + + ca.uhn.hapi.fhir + hapi-fhir-base + 1.1-SNAPSHOT + + + ca.uhn.hapi.fhir + hapi-fhir-structures-dstu2 + 1.1-SNAPSHOT + + + ca.uhn.hapi.fhir + hapi-fhir-jpaserver-base + 1.8-SNAPSHOT + + + + org.hibernate + hibernate-envers + ${hibernate_version} + + + + org.springframework + spring-web + 4.1.3.RELEASE + + + \ No newline at end of file diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/CareSite.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/CareSite.java similarity index 96% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/CareSite.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/CareSite.java index 716f6f8..c2c55c4 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/CareSite.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/CareSite.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.Column; import javax.persistence.Entity; @@ -9,9 +9,12 @@ import javax.persistence.ManyToOne; import javax.persistence.Table; +import org.hibernate.envers.Audited; + @Entity @Table(name="care_site") +@Audited public class CareSite { @Id diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Concept.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Concept.java similarity index 80% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Concept.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Concept.java index 5f3c954..7f1876c 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Concept.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Concept.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import java.util.Date; @@ -12,40 +12,41 @@ import javax.persistence.Table; import org.hibernate.envers.Audited; +import org.hibernate.envers.RelationTargetAuditMode; @Entity @Table(name="concept") -@Audited +@Audited(targetAuditMode=RelationTargetAuditMode.NOT_AUDITED) public class Concept { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) - @Column(name="concept_id") + @Column(name="concept_id", updatable=false) private Long id; - @Column(name="concept_name") + @Column(name="concept_name", updatable=false) private String name; - @Column(name="concept_level") + @Column(name="concept_level", updatable=false) private Integer level; - @Column(name="concept_class") + @Column(name="concept_class", updatable=false) private String klass; @ManyToOne - @JoinColumn(name="vocabulary_id") + @JoinColumn(name="vocabulary_id", updatable=false) private Vocabulary vocabulary; - @Column(name="concept_code") + @Column(name="concept_code", updatable=false) private String conceptCode; - @Column(name="valid_start_date") + @Column(name="valid_start_date", updatable=false) private Date validStartDate; - @Column(name="valid_end_date") + @Column(name="valid_end_date", updatable=false) private Date validEndDate; - @Column(name="invalid_reason") + @Column(name="invalid_reason", updatable=false) private String invalidReason; public Concept() { diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConceptAncestor.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConceptAncestor.java similarity index 96% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConceptAncestor.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConceptAncestor.java index abf381c..d0c618b 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConceptAncestor.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConceptAncestor.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; public class ConceptAncestor { diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConceptRelationship.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConceptRelationship.java similarity index 97% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConceptRelationship.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConceptRelationship.java index 6d33999..783c754 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConceptRelationship.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConceptRelationship.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import java.util.Date; diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConceptSynonym.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConceptSynonym.java similarity index 69% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConceptSynonym.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConceptSynonym.java index 6721d64..ff84dc6 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConceptSynonym.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConceptSynonym.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; public class ConceptSynonym { diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConditionOccurrence.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrence.java similarity index 96% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConditionOccurrence.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrence.java index feb3d93..b4421d2 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ConditionOccurrence.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrence.java @@ -1,7 +1,7 @@ /** * */ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import java.util.Date; @@ -106,7 +106,7 @@ public ConditionOccurrence(Long id, Person person, Concept conditionConcept, Dat /* * (non-Javadoc) * - * @see edu.gatech.i3l.jpa.model.omop.IResourceTable#getRelatedResource() + * @see edu.gatech.i3l.fhir.dstu2.entities.IResourceTable#getRelatedResource() */ @Override public Condition getRelatedResource() { @@ -116,7 +116,7 @@ public Condition getRelatedResource() { // Refer to 4.3.3 at http://hl7-fhir.github.io/condition.html // set Identifier - condition.setId(getIdDt()); + condition.setId(this.getIdDt()); // Set patient reference to Patient (note: in dstu1, this was subject.) ResourceReferenceDt patientReference = new ResourceReferenceDt(person.getIdDt()); @@ -384,14 +384,13 @@ public InstantDt getUpdated() { @Override public String translateSearchParam(String link) { switch (link) { - case Condition.SP_ASSERTER: - System.out.println("translateLink():Asserter=" + link); - return "provider"; + case Condition.SP_CODE: + return "conditionConcept.conceptCode"; case Condition.SP_ENCOUNTER: - System.out.println("translateLink():Encounter=" + link); return "encounter"; case Condition.SP_PATIENT: - System.out.println("translateLink():Patient=" + link); + return "person"; + case Condition.SP_SUBJECT: return "person"; default: break; diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/ConditionFhirExtTable.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrenceComplement.java similarity index 91% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/ConditionFhirExtTable.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrenceComplement.java index 5b94043..453c109 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/ConditionFhirExtTable.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrenceComplement.java @@ -1,7 +1,7 @@ /** * */ -package edu.gatech.i3l.jpa.model.omop.ext; +package edu.gatech.i3l.fhir.dstu2.entities; import java.util.Date; import java.util.List; @@ -19,12 +19,6 @@ import ca.uhn.fhir.model.dstu2.composite.CodingDt; import ca.uhn.fhir.model.dstu2.resource.Condition; import ca.uhn.fhir.model.dstu2.valueset.ConditionClinicalStatusEnum; -import edu.gatech.i3l.jpa.model.omop.Concept; -import edu.gatech.i3l.jpa.model.omop.ConditionOccurrence; -import edu.gatech.i3l.jpa.model.omop.Person; -import edu.gatech.i3l.jpa.model.omop.Provider; -import edu.gatech.i3l.jpa.model.omop.VisitOccurrence; -import edu.gatech.i3l.jpa.model.omop.Vocabulary; /** * @author Myung Choi @@ -33,7 +27,7 @@ @Entity @Table(name="f_condition_occurrence") @PrimaryKeyJoinColumn(name="condition_occurrence_id") -public class ConditionFhirExtTable extends ConditionOccurrence { +public class ConditionOccurrenceComplement extends ConditionOccurrence { @Column(name="fhir_condition_status_code") private String statusCode; @@ -45,11 +39,11 @@ public class ConditionFhirExtTable extends ConditionOccurrence { @JoinColumn(name="condition_severity_concept_id") private Concept severityConcept; - public ConditionFhirExtTable() { + public ConditionOccurrenceComplement() { super(); } - public ConditionFhirExtTable(Long id, Person person, + public ConditionOccurrenceComplement(Long id, Person person, Concept conditionConcept, Date startDate, Date endDate, Concept conditionTypeConcept, String stopReason, Provider provider, VisitOccurrence encounter, String sourceValue, String statusCode, diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Death.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Death.java similarity index 95% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Death.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Death.java index ebaad84..d59e5e0 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Death.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Death.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import java.sql.Date; diff --git a/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposureMedication.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposureMedication.java new file mode 100644 index 0000000..e36fae8 --- /dev/null +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposureMedication.java @@ -0,0 +1,88 @@ +package edu.gatech.i3l.fhir.dstu2.entities; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.envers.Audited; + +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.jpa.entity.BaseResourceEntity; +import ca.uhn.fhir.jpa.entity.IResourceEntity; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.dstu2.resource.Medication; +import ca.uhn.fhir.model.primitive.InstantDt; + +@Entity +@Table(name="drug_exposure") +@Audited +public class DrugExposureMedication extends BaseResourceEntity{ + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="drug_exposure_id") + private Long id; + + @ManyToOne// Notice that this as any other entity mapping, relates to omop structure (drug exposure in this case) and not with fhir resource. + @JoinColumn(name="drug_concept_id") + private Concept drugConcept; + + @Override + public Long getId() { + return this.id; + } + + public void setId(Long id){ + this.id = id; + } + + @Override + public FhirVersionEnum getFhirVersion() { + return FhirVersionEnum.DSTU2; + } + + @Override + public String getResourceType() { + return "Medication"; + } + + @Override + public InstantDt getUpdated() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String translateSearchParam(String theSearchParam) { + switch (theSearchParam) { + case Medication.SP_NAME: + return "drugConcept.name"; + default: + break; + } + return theSearchParam; + } + + @Override + public IResource getRelatedResource() { + Medication resource = new Medication(); + resource.setId(this.getIdDt()); + resource.setName(this.drugConcept.getName()); + return resource; + } + + /** + * This entity relates to a omop concept registry and is not supposed to be created/updated. + */ + //TODO somehow we should be able to send message back in an OperationOutcome + @Override + public IResourceEntity constructEntityFromResource(IResource resource) { + return null; + } + +} diff --git a/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionDispensed.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionDispensed.java new file mode 100644 index 0000000..c442603 --- /dev/null +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionDispensed.java @@ -0,0 +1,156 @@ +package edu.gatech.i3l.fhir.dstu2.entities; + +import java.math.BigDecimal; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.envers.Audited; + +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.jpa.entity.BaseResourceEntity; +import ca.uhn.fhir.jpa.entity.IResourceEntity; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.dstu2.composite.QuantityDt; +import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu2.resource.MedicationDispense; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.primitive.InstantDt; + +@Entity +@Table(name="drug_exposure") +@Audited +public class DrugExposurePrescriptionDispensed extends BaseResourceEntity{ + + public static final String RES_TYPE = "MedicationDispense"; + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="drug_exposure_id", updatable= false) + private Long id; + + @ManyToOne + @JoinColumn(name="drug_type_concept_id", updatable= false, nullable=false) + private Concept drugExposureType; + + @ManyToOne + @JoinColumn(name="person_id", updatable=false, nullable=false) + private Person person; + + @Column(name="quantity", updatable=false) + private BigDecimal quantity; + + @Column(name="days_supply",updatable=false) + private Integer daysSupply; + + @ManyToOne + @JoinColumn(name="drug_concept_id", updatable=false) + private Concept medication; + + @Override + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } + + public BigDecimal getQuantity() { + return quantity; + } + + public void setQuantity(BigDecimal quantity) { + this.quantity = quantity; + } + + public Integer getDaysSupply() { + return daysSupply; + } + + public void setDaysSupply(Integer daysSupply) { + this.daysSupply = daysSupply; + } + + public Concept getMedication() { + return medication; + } + + public void setMedication(Concept medication) { + this.medication = medication; + } + + public Concept getDrugExposureType() { + return drugExposureType; + } + + public void setDrugExposureType(Concept drugExposureType) { + this.drugExposureType = drugExposureType; + } + + @Override + public FhirVersionEnum getFhirVersion() { + return FhirVersionEnum.DSTU2; + } + + @Override + public String getResourceType() { + return RES_TYPE; + } + + @Override + public InstantDt getUpdated() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String translateSearchParam(String theSearchParam) { + switch (theSearchParam) { + case MedicationDispense.SP_PATIENT: + return "person"; + case MedicationDispense.SP_MEDICATION: + return "medication.name"; + default: + break; + } + return theSearchParam; + } + + @Override + public IResource getRelatedResource() { + MedicationDispense resource = new MedicationDispense(); + resource.setId(this.getIdDt()); + resource.setPatient(new ResourceReferenceDt(new IdDt(this.person.getId()))); + resource.setMedication(new ResourceReferenceDt(new IdDt(this.medication.getId()))); + if(this.quantity != null) + resource.setQuantity(new QuantityDt(this.quantity.doubleValue())); + if(this.daysSupply != null) + resource.setDaysSupply(new QuantityDt(this.daysSupply)); + return resource; + } + + /* + * Not Updatable. So this is not meant to be implemented. + * @see ca.uhn.fhir.jpa.entity.IResourceEntity#constructEntityFromResource(ca.uhn.fhir.model.api.IResource) + */ + @Override + public IResourceEntity constructEntityFromResource(IResource resource) { + return null; + } + +} diff --git a/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWritten.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWritten.java new file mode 100644 index 0000000..a8bfcf7 --- /dev/null +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWritten.java @@ -0,0 +1,293 @@ +package edu.gatech.i3l.fhir.dstu2.entities; + +import static ca.uhn.fhir.model.dstu2.resource.MedicationPrescription.SP_ENCOUNTER; +import static ca.uhn.fhir.model.dstu2.resource.MedicationPrescription.SP_MEDICATION; +import static ca.uhn.fhir.model.dstu2.resource.MedicationPrescription.SP_PATIENT; + +import java.math.BigDecimal; +import java.util.Calendar; +import java.util.Date; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +import org.hibernate.envers.Audited; + +import ca.uhn.fhir.context.FhirVersionEnum; +import ca.uhn.fhir.jpa.entity.BaseResourceEntity; +import ca.uhn.fhir.jpa.entity.IResourceEntity; +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.dstu2.composite.PeriodDt; +import ca.uhn.fhir.model.dstu2.composite.QuantityDt; +import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt; +import ca.uhn.fhir.model.dstu2.resource.MedicationPrescription; +import ca.uhn.fhir.model.dstu2.resource.MedicationPrescription.Dispense; +import ca.uhn.fhir.model.primitive.DateTimeDt; +import ca.uhn.fhir.model.primitive.IdDt; +import ca.uhn.fhir.model.primitive.InstantDt; + +@Entity +@Table(name="drug_exposure") +@Inheritance(strategy=InheritanceType.JOINED) +@Audited +public class DrugExposurePrescriptionWritten extends BaseResourceEntity { + + public static final String RES_TYPE = "MedicationPrescription"; + + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + @Column(name="drug_exposure_id", updatable= false) + private Long id; + + @ManyToOne + @JoinColumn(name="person_id", updatable= false, nullable=false) + private Person person; + + /** + * For this entity, drug type (name of the concept) is Prescription Written; it is declared with id 38000177 and vocabulary_id 36, + * in an Omop v4.0 compliant database, but this implementation is database independent, since we use {@link OmopConceptMapping} to + * gather the information in the database. + */ + @ManyToOne + @JoinColumn(name="drug_type_concept_id", updatable= false, nullable=false) + private Concept drugExposureType; + + /** + * Reflects the date the prescription was written. + * @fhir dateWritten + */ + @Column(name="drug_exposure_start_date", updatable= false, nullable=false) + private Date startDate; + + /** + * @fhir prescriber + */ + @ManyToOne + @JoinColumn(name="prescribing_provider_id", updatable= false) + private Provider prescribingProvider; + + /** + * @fhir encounter + */ + @ManyToOne + @JoinColumn(name="visit_occurrence_id", updatable= false, nullable=false) + private VisitOccurrenceComplement visitOccurrence; + + /** + * @notice Note that this is not a direct reference to a specific condition record, {@link ConditionOccurrence}, in the condition table, but rather a + * condition concept in the vocabulary. + * @fhir reason + */ + @ManyToOne + @JoinColumn(name="relevant_condition_concept_id", updatable= false) + private Concept relevantCondition; //TODO check other cases where a Concept can be taken as COndition + + /* + ***************************** + * ATTRIBUTES FOR DISPENSE + *****************************/ + /** + * RxNorm. + * Generally in concept class 'Clinical Drug'. + */ + @ManyToOne + @JoinColumn(name="drug_concept_id", updatable= false, nullable=false) + private Concept medication; + + /** + * @fhir quantity + */ + @Column(name="quantity", updatable= false) + private BigDecimal quantity; + + /** + * The period of validity of the prescription, in days, counting from the initial date of this prescription. + * @fhir validityPeriod + */ + @Column(name="days_supply", updatable= false) + private Integer daysSupply; + + /** + * @omop The number of refills after the initial prescription. The initial prescription is not counted, values start with 0. + * @fhir numberOfRepeatsAllowed + */ + @Column(name="refills", updatable= false) + private Integer refills; + + /* + * ******************************** + * END ATTRIBUTES FOR DISPENSE + * ********************************/ + + public Person getPerson() { + return person; + } + + public void setPerson(Person person) { + this.person = person; + } + + public Concept getMedication() { + return medication; + } + + public void setMedication(Concept medication) { + this.medication = medication; + } + + public Concept getDrugExposureType() { + return drugExposureType; + } + + public void setDrugExposureType(Concept drugExposureType) { + this.drugExposureType = drugExposureType; + } + + @Override + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public BigDecimal getQuantity() { + return quantity; + } + + public void setQuantity(BigDecimal quantity) { + this.quantity = quantity; + } + + public Date getStartDate() { + return startDate; + } + + public void setStartDate(Date startDate) { + this.startDate = startDate; + } + + public Provider getPrescribingProvider() { + return prescribingProvider; + } + + public void setPrescribingProvider(Provider prescribingProvider) { + this.prescribingProvider = prescribingProvider; + } + + public VisitOccurrenceComplement getVisitOccurrence() { + return visitOccurrence; + } + + public void setVisitOccurrence(VisitOccurrenceComplement visitOccurrence) { + this.visitOccurrence = visitOccurrence; + } + + public Concept getRelevantCondition() { + return relevantCondition; + } + + public void setRelevantCondition(Concept relevantCondition) { + this.relevantCondition = relevantCondition; + } + + public Integer getDaysSupply() { + return daysSupply; + } + + public void setDaysSupply(Integer daysSupply) { + this.daysSupply = daysSupply; + } + + public Integer getRefills() { + return refills; + } + + public void setRefills(Integer refills) { + this.refills = refills; + } + + @Override + public FhirVersionEnum getFhirVersion() { + return FhirVersionEnum.DSTU2; + } + + @Override + public String getResourceType() { + return RES_TYPE; + } + + @Override + public InstantDt getUpdated() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String translateSearchParam(String theSearchParam) { + switch (theSearchParam) { + case SP_ENCOUNTER: + return "visitOccurrence"; + case SP_PATIENT: + return "person"; + case SP_MEDICATION: + return "medication.name"; + default: + break; + } + return theSearchParam; + } + + @Override + public IResource getRelatedResource() { + MedicationPrescription resource = new MedicationPrescription(); + resource.setId(this.getIdDt()); + resource.setDateWritten(new DateTimeDt(this.startDate)); + /* Begin Setting Dispense */ + Dispense dispense = new Dispense(); + dispense.setMedication(new ResourceReferenceDt(new IdDt(this.medication.getId()))); + if(this.refills != null) + dispense.setNumberOfRepeatsAllowed(this.refills); + if(this.quantity != null) + dispense.setQuantity(new QuantityDt(this.quantity.doubleValue())); + //setting validity + Calendar c = Calendar.getInstance(); + c.setTime(this.startDate); + PeriodDt period = new PeriodDt(); + period.setStart(new DateTimeDt(c.getTime())); + if(this.daysSupply != null){ + c.add(Calendar.DAY_OF_MONTH, this.daysSupply); + period.setEnd(new DateTimeDt(c.getTime())); + } + dispense.setValidityPeriod(period); + + resource.setDispense(dispense); + /* End Setting Dispense */ + resource.setEncounter(new ResourceReferenceDt(new IdDt(this.visitOccurrence.getId()))); + resource.setPatient(new ResourceReferenceDt(new IdDt(this.person.getId()))); + if(this.relevantCondition != null) + resource.setReason(new ResourceReferenceDt(new IdDt(this.relevantCondition.getId()))); + if(this.prescribingProvider != null) + resource.setPrescriber(new ResourceReferenceDt(new IdDt(this.prescribingProvider.getId()))); + + return resource; + } + + @Override + public IResourceEntity constructEntityFromResource(IResource resource) { + MedicationPrescription mp = (MedicationPrescription) resource; + this.medication.setId(mp.getMedication().getReference().getIdPartAsLong()); //TODO check if id exists, TODO turn MedicationPrescription not updatable + this.person.setId(mp.getPatient().getReference().getIdPartAsLong()); + return this; + } + +} diff --git a/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWrittenComplement.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWrittenComplement.java new file mode 100644 index 0000000..a7210d0 --- /dev/null +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWrittenComplement.java @@ -0,0 +1,72 @@ +package edu.gatech.i3l.fhir.dstu2.entities; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.PrimaryKeyJoinColumn; +import javax.persistence.Table; + +import org.hibernate.envers.Audited; + +import ca.uhn.fhir.model.api.IResource; +import ca.uhn.fhir.model.dstu2.composite.QuantityDt; +import ca.uhn.fhir.model.dstu2.resource.MedicationPrescription; +import ca.uhn.fhir.model.dstu2.resource.MedicationPrescription.DosageInstruction; +import ca.uhn.fhir.model.dstu2.valueset.QuantityComparatorEnum; + +/** + * @fhirVersion 2.0 + * @author Ismael Sarmento + */ +@Entity +@Table(name="f_drug_exposure") +@PrimaryKeyJoinColumn(name="drug_exposure_id") +@Audited +public class DrugExposurePrescriptionWrittenComplement extends DrugExposurePrescriptionWritten { + + /** + * @fhir MedicationPrescription.dosageInstruction.dose.doseQuantity + */ + @Column(name="dose") + private String dose; +// @Column(name="effective_drug_dose") +// private BigDecimal dose; + + /** + * The corresponding unit for the dose quantity. + */ + @Column(name="unit") + private String unit; +// @Column(name="dose_unit_concept_id") +// private Concept unit; + + + + public String getDose() { + return dose; + } + + + public void setDose(String dose) { + this.dose = dose; + } + + + public String getUnit() { + return unit; + } + + + public void setUnit(String unit) { + this.unit = unit; + } + + @Override + public IResource getRelatedResource() { + MedicationPrescription resource = (MedicationPrescription) super.getRelatedResource(); + DosageInstruction dosage = new DosageInstruction(); + dosage.setDose(new QuantityDt(QuantityComparatorEnum.LESSTHAN_OR_EQUALS, Double.parseDouble(this.dose), this.unit)); + resource.addDosageInstruction(dosage); + return resource; + } + +} diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/EpisodeOfCare.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/EpisodeOfCare.java similarity index 94% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/EpisodeOfCare.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/EpisodeOfCare.java index 4863cf0..578a3a1 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/EpisodeOfCare.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/EpisodeOfCare.java @@ -1,7 +1,7 @@ /** * */ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.Column; import javax.persistence.Entity; @@ -12,6 +12,8 @@ import javax.persistence.ManyToOne; import javax.persistence.Table; +import org.hibernate.envers.Audited; + import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.jpa.entity.BaseResourceEntity; import ca.uhn.fhir.jpa.entity.IResourceEntity; @@ -25,6 +27,7 @@ */ @Entity @Table(name="episode_of_care") +@Audited public class EpisodeOfCare extends BaseResourceEntity { @Id @@ -68,7 +71,7 @@ public void setEpisodeSourceValue(String episodeSourceValue) { } /* (non-Javadoc) - * @see edu.gatech.i3l.jpa.model.omop.IResourceTable#getRelatedResource() + * @see edu.gatech.i3l.fhir.dstu2.entities.IResourceTable#getRelatedResource() */ @Override public ca.uhn.fhir.model.dstu2.resource.EpisodeOfCare getRelatedResource() { diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Location.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Location.java similarity index 98% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Location.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Location.java index ddd7529..70e7de5 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Location.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Location.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.Column; import javax.persistence.Entity; diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/LocationFhirExtTable.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/LocationComplement.java similarity index 86% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/LocationFhirExtTable.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/LocationComplement.java index 7b66f0d..2d38fe3 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/LocationFhirExtTable.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/LocationComplement.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop.ext; +package edu.gatech.i3l.fhir.dstu2.entities; import java.util.Date; @@ -13,13 +13,12 @@ import org.hibernate.envers.RelationTargetAuditMode; import ca.uhn.fhir.model.dstu2.valueset.AddressUseEnum; -import edu.gatech.i3l.jpa.model.omop.Location; @Entity @Table(name="f_location") @PrimaryKeyJoinColumn(name="location_id") @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) -public class LocationFhirExtTable extends Location{ +public class LocationComplement extends Location{ @Column(name="address_use") @Enumerated(EnumType.STRING) @@ -31,7 +30,7 @@ public class LocationFhirExtTable extends Location{ @Column(name="end_date") private Date endDate; - public LocationFhirExtTable() { + public LocationComplement() { super(); } diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Observation.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Observation.java similarity index 99% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Observation.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Observation.java index 638c66b..72593c0 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Observation.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Observation.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import static ca.uhn.fhir.model.dstu2.resource.Observation.SP_ENCOUNTER; import static ca.uhn.fhir.model.dstu2.resource.Observation.SP_SUBJECT; diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/OmopConceptMapping.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/OmopConceptMapping.java similarity index 94% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/OmopConceptMapping.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/OmopConceptMapping.java index 0c44c69..dc4ae53 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/OmopConceptMapping.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/OmopConceptMapping.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import java.util.HashMap; import java.util.List; @@ -29,10 +29,14 @@ public class OmopConceptMapping implements Runnable { private static OmopConceptMapping omopConceptMapping = new OmopConceptMapping(); private EntityManager entityManager; + /* + * Concepts' Classes + */ public static final String GENDER = "Gender"; public static final String MARITAL_STATUS = "Marital Status"; - private static final String GENDER_VOCABULARY = "HL7 Administrative Sex"; + public static final String DRUG_EXPOSURE_TYPE = "Drug Exposure Type"; + public static final String GENDER_VOCABULARY = "HL7 Administrative Sex"; /** * A mapping for some of the existing concepts in the database. The key for the outter mapping is the Concept Class. * The inner map has the value(name) of the Concept as key and the respective id in the database as values in the map. diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Organization.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Organization.java similarity index 95% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Organization.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Organization.java index ecf5cbc..e46235a 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Organization.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Organization.java @@ -1,7 +1,7 @@ /** * */ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.Column; import javax.persistence.Entity; @@ -12,6 +12,8 @@ import javax.persistence.ManyToOne; import javax.persistence.Table; +import org.hibernate.envers.Audited; + import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.jpa.entity.BaseResourceEntity; import ca.uhn.fhir.jpa.entity.IResourceEntity; @@ -25,6 +27,7 @@ */ @Entity @Table(name="organization") +@Audited public class Organization extends BaseResourceEntity { public static final String RESOURCE_TYPE = "Organization"; @@ -96,7 +99,7 @@ public void setPlaceOfServiceSourceValue(String placeOfServiceSourceValue) { } /* (non-Javadoc) - * @see edu.gatech.i3l.jpa.model.omop.IResourceTable#getRelatedResource() + * @see edu.gatech.i3l.fhir.dstu2.entities.IResourceTable#getRelatedResource() */ @Override public ca.uhn.fhir.model.dstu2.resource.Organization getRelatedResource() { diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Person.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Person.java similarity index 90% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Person.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Person.java index 590440f..2f95f9a 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Person.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Person.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import java.util.Calendar; import java.util.Set; @@ -29,9 +29,7 @@ import ca.uhn.fhir.model.dstu2.valueset.AdministrativeGenderEnum; import ca.uhn.fhir.model.primitive.DateDt; import ca.uhn.fhir.model.primitive.DateTimeDt; -import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; -import edu.gatech.i3l.jpa.model.omop.ext.LocationFhirExtTable; @Entity @Audited @@ -57,7 +55,7 @@ public class Person extends BaseResourceEntity{ @ManyToOne(cascade={CascadeType.MERGE}) @JoinColumn(name="location_id") - private LocationFhirExtTable location; + private LocationComplement location; /** * Makes the indirect relationship between the person and the Care Site. @@ -100,7 +98,7 @@ public Person() { } public Person(Long id, Integer yearOfBirth, Integer monthOfBirth, - Integer dayOfBirth, LocationFhirExtTable location, Provider provider, String personSourceValue, + Integer dayOfBirth, LocationComplement location, Provider provider, String personSourceValue, String genderSourceValue, Concept genderConcept, String ethnicitySourceValue, Concept ethnicityConcept, String raceSourceValue, Concept raceConcept) { @@ -136,10 +134,6 @@ public void setConditions(Set conditions) { this.conditions = conditions; } - public IdDt getIdDt() { - return new IdDt(getResourceType(), id); - } - public Integer getYearOfBirth() { return yearOfBirth; } @@ -164,11 +158,11 @@ public void setDayOfBirth(Integer dayOfBirth) { this.dayOfBirth = dayOfBirth; } - public LocationFhirExtTable getLocation() { + public LocationComplement getLocation() { return location; } - public void setLocation(LocationFhirExtTable location) { + public void setLocation(LocationComplement location) { this.location = location; } @@ -247,7 +241,7 @@ public void setRaceConcept(Concept raceConcept) { @Override public Patient getRelatedResource() { Patient patient = new Patient(); - patient.setId(new IdDt(this.getResourceType(), String.valueOf(this.getId()), String.valueOf(this.getVersion()))); + patient.setId(this.getIdDt()); Calendar calendar = Calendar.getInstance(); calendar.set(this.yearOfBirth, this.monthOfBirth, this.dayOfBirth); @@ -289,14 +283,9 @@ public String getResourceType() { return RESOURCE_TYPE; } - public Class getRelatedResourceType() { - return Patient.class; - } - @Override public FhirVersionEnum getFhirVersion() { - // TODO Auto-generated method stub - return null; + return FhirVersionEnum.DSTU2; } @Override @@ -320,17 +309,17 @@ public IResourceEntity constructEntityFromResource(IResource resource) { this.genderConcept = new Concept(); this.genderConcept.setId(OmopConceptMapping.getInstance().get(OmopConceptMapping.GENDER, patient.getGender())); - LocationFhirExtTable location; + LocationComplement location; if(this.location != null){ location = this.location; }else { - location = new LocationFhirExtTable(); + location = new LocationComplement(); } AddressDt address = patient.getAddress().get(0); location.setAddressUse(address.getUseElement().getValueAsEnum()); - location.setAddress1(address.getLine().iterator().next().getValue()); + location.setAddress1(address.getLine().get(0).getValue()); if (address.getLine().size() > 1)// iterator.hasNext or listIterator.hasNext were returning true in all cases - location.setAddress2(address.getLine().iterator().next().getValue()); + location.setAddress2(address.getLine().get(1).getValue()); location.setZipCode(address.getPostalCode()); location.setCity(address.getCity()); location.setState(address.getState()); diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/PatientFhirExtTable.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/PersonComplement.java similarity index 93% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/PatientFhirExtTable.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/PersonComplement.java index 62d3beb..a87cf99 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/PatientFhirExtTable.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/PersonComplement.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop.ext; +package edu.gatech.i3l.fhir.dstu2.entities; import java.util.Iterator; @@ -16,8 +16,6 @@ import ca.uhn.fhir.model.dstu2.composite.HumanNameDt; import ca.uhn.fhir.model.dstu2.resource.Patient; import ca.uhn.fhir.model.primitive.StringDt; -import edu.gatech.i3l.jpa.model.omop.Concept; -import edu.gatech.i3l.jpa.model.omop.Person; /** * This class adds some properties to the Omop data model Person, in order to provide @@ -28,9 +26,9 @@ @Table(name="f_person") @PrimaryKeyJoinColumn(name="person_id") @Audited -public class PatientFhirExtTable extends Person{ +public class PersonComplement extends Person{ - private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(PatientFhirExtTable.class); + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(PersonComplement.class); @Column(name="family_name") private String familyName; @@ -60,7 +58,7 @@ public class PatientFhirExtTable extends Person{ @Column(name="active") private Boolean active; - public PatientFhirExtTable() { + public PersonComplement() { super(); } @@ -158,7 +156,7 @@ public Patient getRelatedResource() { } /** - * @notice In Fhir model, {@link Patient} has a collection of names, while in this extension table, {@link PatientFhirExtTable}, + * @notice In Fhir model, {@link Patient} has a collection of names, while in this extension table, {@link PersonComplement}, * there is only one name for each {@link Person}. */ @Override diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Provider.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Provider.java similarity index 95% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Provider.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Provider.java index 1254c7d..2edd0da 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Provider.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Provider.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.Column; import javax.persistence.Entity; @@ -12,7 +12,6 @@ import javax.persistence.Table; import org.hibernate.envers.Audited; -import org.hibernate.envers.RelationTargetAuditMode; import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.jpa.entity.BaseResourceEntity; @@ -26,7 +25,7 @@ @Entity @Table(name="provider") @Inheritance(strategy=InheritanceType.JOINED) -@Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED) +@Audited public class Provider extends BaseResourceEntity { public static final String RESOURCE_TYPE = "Practitioner|Organization"; @@ -119,7 +118,6 @@ public void setSpecialtySourceValue(String specialtySourceValue) { this.specialtySourceValue = specialtySourceValue; } - @SuppressWarnings("unchecked") @Override public Practitioner getRelatedResource() { Practitioner practitioner = new Practitioner(); diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/ProviderFhirExtTable.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ProviderComplement.java similarity index 85% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/ProviderFhirExtTable.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ProviderComplement.java index 1faa2ad..d501c73 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/ProviderFhirExtTable.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/ProviderComplement.java @@ -1,7 +1,7 @@ /** * */ -package edu.gatech.i3l.jpa.model.omop.ext; +package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.Column; import javax.persistence.Entity; @@ -11,9 +11,6 @@ import javax.persistence.Table; import ca.uhn.fhir.model.dstu2.resource.Practitioner; -import edu.gatech.i3l.jpa.model.omop.CareSite; -import edu.gatech.i3l.jpa.model.omop.Concept; -import edu.gatech.i3l.jpa.model.omop.Provider; /** * @author Myung Choi @@ -22,7 +19,7 @@ @Entity @Table(name="f_provider") @PrimaryKeyJoinColumn(name="provider_id") -public class ProviderFhirExtTable extends Provider { +public class ProviderComplement extends Provider { @Column(name="name") private String name; @@ -40,11 +37,11 @@ public class ProviderFhirExtTable extends Provider { @JoinColumn(name="gender_concept_id") private Concept genderConcept; - public ProviderFhirExtTable() { + public ProviderComplement() { super(); } - public ProviderFhirExtTable(Long id, String npi, String dea, Concept specialtyConcept, + public ProviderComplement(Long id, String npi, String dea, Concept specialtyConcept, CareSite careSite, String providerSourceValue, String specialtySourceValue, String name, Integer yearOfBirth, Integer monthOfBirth, Integer dayOfBirth, Concept genderConcept) { super(id, npi, dea, specialtyConcept, careSite, providerSourceValue, specialtySourceValue); diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Relationship.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Relationship.java similarity index 97% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Relationship.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Relationship.java index c5d1c5f..cbbe861 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Relationship.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Relationship.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; public class Relationship { diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/VisitOccurrence.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrence.java similarity index 94% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/VisitOccurrence.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrence.java index 69def54..6ecdcb5 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/VisitOccurrence.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrence.java @@ -1,7 +1,7 @@ /** * */ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import java.util.Date; @@ -16,6 +16,8 @@ import javax.persistence.ManyToOne; import javax.persistence.Table; +import org.hibernate.envers.Audited; + import ca.uhn.fhir.context.FhirVersionEnum; import ca.uhn.fhir.jpa.entity.BaseResourceEntity; import ca.uhn.fhir.jpa.entity.IResourceEntity; @@ -26,6 +28,8 @@ import ca.uhn.fhir.model.dstu2.valueset.EncounterClassEnum; import ca.uhn.fhir.model.primitive.IdDt; import ca.uhn.fhir.model.primitive.InstantDt; +import static ca.uhn.fhir.model.dstu2.resource.Encounter.SP_DATE; +import static ca.uhn.fhir.model.dstu2.resource.Encounter.SP_PATIENT;; /** * @author Myung Choi @@ -34,6 +38,7 @@ @Entity @Table(name="visit_occurrence") @Inheritance(strategy=InheritanceType.JOINED) +@Audited public class VisitOccurrence extends BaseResourceEntity { public static final String RESOURCE_TYPE = "Encounter"; @@ -130,7 +135,7 @@ public void setPlaceOfServiceSourceValue(String placeOfServiceSourceValue) { } /* (non-Javadoc) - * @see edu.gatech.i3l.jpa.model.omop.IResourceTable#getRelatedResource() + * @see edu.gatech.i3l.fhir.dstu2.entities.IResourceTable#getRelatedResource() */ @Override public Encounter getRelatedResource() { @@ -138,7 +143,7 @@ public Encounter getRelatedResource() { // http://hl7-fhir.github.io/encounter.html // - encounter.setId(getIdDt()); + encounter.setId(this.getIdDt()); // set class String place_of_service = getPlaceOfServiceConcept().getName().toLowerCase(); @@ -248,14 +253,16 @@ public IResourceEntity constructEntityFromResource(IResource resource) { this.careSite.setOrganization(organization); this.careSite.setLocation(location); //TODO set place of service concept - return null; + return this; } @Override public String translateSearchParam(String param) { switch (param) { - case Encounter.SP_PATIENT: + case SP_PATIENT: return "person"; + case SP_DATE: + return "startDate"; default: break; } diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/VisitOccurrenceFhirExtTable.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrenceComplement.java similarity index 84% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/VisitOccurrenceFhirExtTable.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrenceComplement.java index bdc30bf..aca2b97 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/ext/VisitOccurrenceFhirExtTable.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrenceComplement.java @@ -1,7 +1,7 @@ /** * */ -package edu.gatech.i3l.jpa.model.omop.ext; +package edu.gatech.i3l.fhir.dstu2.entities; import java.util.Date; @@ -12,14 +12,11 @@ import javax.persistence.PrimaryKeyJoinColumn; import javax.persistence.Table; +import org.hibernate.envers.Audited; + import ca.uhn.fhir.model.dstu2.composite.ResourceReferenceDt; import ca.uhn.fhir.model.dstu2.resource.Encounter; import ca.uhn.fhir.model.dstu2.valueset.EncounterStateEnum; -import edu.gatech.i3l.jpa.model.omop.CareSite; -import edu.gatech.i3l.jpa.model.omop.Concept; -import edu.gatech.i3l.jpa.model.omop.EpisodeOfCare; -import edu.gatech.i3l.jpa.model.omop.Person; -import edu.gatech.i3l.jpa.model.omop.VisitOccurrence; /** * @author Myung Choi @@ -28,7 +25,8 @@ @Entity @Table(name="f_visit_occurrence") @PrimaryKeyJoinColumn(name="visit_occurrence_id") -public class VisitOccurrenceFhirExtTable extends VisitOccurrence { +@Audited +public class VisitOccurrenceComplement extends VisitOccurrence { @ManyToOne @JoinColumn(name="episode_of_care_id") @@ -40,11 +38,11 @@ public class VisitOccurrenceFhirExtTable extends VisitOccurrence { @Column(name="note") private String note; - public VisitOccurrenceFhirExtTable() { + public VisitOccurrenceComplement() { super(); } - public VisitOccurrenceFhirExtTable(Long id, Person person, Date startDate, Date endDate, + public VisitOccurrenceComplement(Long id, Person person, Date startDate, Date endDate, Concept placeOfServiceConcept, CareSite careSite, String placeOfServiceSourceValue, EpisodeOfCare episodeOfCare, String status, String note) { super(id, person, startDate, endDate, placeOfServiceConcept, careSite, placeOfServiceSourceValue); diff --git a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Vocabulary.java b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Vocabulary.java similarity index 89% rename from gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Vocabulary.java rename to gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Vocabulary.java index 06b2d36..659c97e 100644 --- a/gt-fhir-webapp/src/main/java/edu/gatech/i3l/jpa/model/omop/Vocabulary.java +++ b/gt-fhir-entities/src/main/java/edu/gatech/i3l/fhir/dstu2/entities/Vocabulary.java @@ -1,4 +1,4 @@ -package edu.gatech.i3l.jpa.model.omop; +package edu.gatech.i3l.fhir.dstu2.entities; import javax.persistence.Column; import javax.persistence.Entity; @@ -8,18 +8,19 @@ import javax.persistence.Table; import org.hibernate.envers.Audited; +import org.hibernate.envers.RelationTargetAuditMode; @Entity @Table(name="vocabulary") -@Audited +@Audited(targetAuditMode=RelationTargetAuditMode.NOT_AUDITED) public class Vocabulary { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) - @Column(name="vocabulary_id") + @Column(name="vocabulary_id", updatable=false) private Long id; - @Column(name="vocabulary_name") + @Column(name="vocabulary_name", updatable=false) private String name; public Vocabulary() { diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/CareSite.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/CareSite.class new file mode 100644 index 0000000..82dfdf8 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/CareSite.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Concept.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Concept.class new file mode 100644 index 0000000..40059bb Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Concept.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConceptAncestor.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConceptAncestor.class new file mode 100644 index 0000000..453f2d1 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConceptAncestor.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConceptRelationship.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConceptRelationship.class new file mode 100644 index 0000000..5737c66 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConceptRelationship.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConceptSynonym.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConceptSynonym.class new file mode 100644 index 0000000..604c2fc Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConceptSynonym.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrence.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrence.class new file mode 100644 index 0000000..39ecf9c Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrence.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrenceComplement.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrenceComplement.class new file mode 100644 index 0000000..578755c Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ConditionOccurrenceComplement.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Death.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Death.class new file mode 100644 index 0000000..e803fd8 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Death.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposureMedication.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposureMedication.class new file mode 100644 index 0000000..e9b8592 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposureMedication.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionDispensed.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionDispensed.class new file mode 100644 index 0000000..4597709 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionDispensed.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWritten.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWritten.class new file mode 100644 index 0000000..01d4803 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWritten.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWrittenComplement.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWrittenComplement.class new file mode 100644 index 0000000..344044b Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/DrugExposurePrescriptionWrittenComplement.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/EpisodeOfCare.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/EpisodeOfCare.class new file mode 100644 index 0000000..4f6997b Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/EpisodeOfCare.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Location.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Location.class new file mode 100644 index 0000000..1fd5505 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Location.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/LocationComplement.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/LocationComplement.class new file mode 100644 index 0000000..0bc688e Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/LocationComplement.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Observation.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Observation.class new file mode 100644 index 0000000..166e25c Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Observation.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/OmopConceptMapping.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/OmopConceptMapping.class new file mode 100644 index 0000000..98445bf Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/OmopConceptMapping.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Organization.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Organization.class new file mode 100644 index 0000000..aa77e81 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Organization.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Person.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Person.class new file mode 100644 index 0000000..9b2f6a8 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Person.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/PersonComplement.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/PersonComplement.class new file mode 100644 index 0000000..e05d3c7 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/PersonComplement.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Provider.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Provider.class new file mode 100644 index 0000000..0665884 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Provider.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ProviderComplement.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ProviderComplement.class new file mode 100644 index 0000000..db93755 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/ProviderComplement.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Relationship.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Relationship.class new file mode 100644 index 0000000..9ec19ba Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Relationship.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrence.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrence.class new file mode 100644 index 0000000..f188a2c Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrence.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrenceComplement.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrenceComplement.class new file mode 100644 index 0000000..44f41e2 Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/VisitOccurrenceComplement.class differ diff --git a/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Vocabulary.class b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Vocabulary.class new file mode 100644 index 0000000..26124dd Binary files /dev/null and b/gt-fhir-entities/target/classes/edu/gatech/i3l/fhir/dstu2/entities/Vocabulary.class differ diff --git a/gt-fhir-entities/target/gt-fhir-entities-1.0-SNAPSHOT.jar b/gt-fhir-entities/target/gt-fhir-entities-1.0-SNAPSHOT.jar new file mode 100644 index 0000000..b1f1a18 Binary files /dev/null and b/gt-fhir-entities/target/gt-fhir-entities-1.0-SNAPSHOT.jar differ diff --git a/gt-fhir-entities/target/gt-fhir-entities-1.0.jar b/gt-fhir-entities/target/gt-fhir-entities-1.0.jar new file mode 100644 index 0000000..135bf44 Binary files /dev/null and b/gt-fhir-entities/target/gt-fhir-entities-1.0.jar differ diff --git a/gt-fhir-entities/target/maven-archiver/pom.properties b/gt-fhir-entities/target/maven-archiver/pom.properties new file mode 100644 index 0000000..b6b55a0 --- /dev/null +++ b/gt-fhir-entities/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Sat Jul 25 00:58:45 EDT 2015 +version=1.0 +groupId=edu.gatech.i3l +artifactId=gt-fhir-entities diff --git a/gt-fhir-overlay/pom.xml b/gt-fhir-overlay/pom.xml index 4e0788d..55c9017 100644 --- a/gt-fhir-overlay/pom.xml +++ b/gt-fhir-overlay/pom.xml @@ -2,7 +2,7 @@ 4.0.0 edu.gatech.i3l gt-fhir-overlay - 1.1-SNAPSHOT + 1.0 war GT-FHIR Overlay @@ -106,7 +106,7 @@ ca.uhn.hapi.fhir hapi-fhir-jpaserver-base - 1.6-SNAPSHOT + 1.8-SNAPSHOT ca.uhn.hapi.fhir diff --git a/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/_result.html b/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/_result.html new file mode 100644 index 0000000..45779c7 --- /dev/null +++ b/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/_result.html @@ -0,0 +1,353 @@ + + + + RESTful Tester + + + +
+ + +
+ +
+
+ +
+ +
+ +
+ + + + +
+ Executed request against FHIR RESTful server in + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + Request + + + +
Request Headers +
+ + +
+
Request Body +
...loading...
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + Response + + + + +
Response Headers +
+ + +
+
+ Result Body + + + + +
+
+
+

+ Bundle contains no entries + + + + + + + + + + + + + + + +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
IDTitleUpdated
+ + + + + + + +
+
+
+ +
+
+
+
+

+ + + Manage Resource + +

+
+
+ + + + + + + + + + + + +
+ + + + +
+
+
+
+
+
+
+
+
+

+ Raw Message +

+
+
+
...loading...
+ +
Result Narrative
+ + + +
+ + +
+
+
+ +
+
+ + diff --git a/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/resource.html b/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/resource.html index 087be5a..3db6739 100644 --- a/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/resource.html +++ b/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/resource.html @@ -115,7 +115,7 @@

Search Parameters Optionally add parameter(s) to the search -
+
@@ -187,7 +187,7 @@

Other Options


-
+
diff --git a/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/result.html b/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/result.html index 45779c7..af56693 100644 --- a/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/result.html +++ b/gt-fhir-overlay/src/main/webapp/WEB-INF/templates/result.html @@ -27,7 +27,7 @@
- +
@@ -208,45 +208,18 @@

- + -
-
-

- - - Manage Resource - -

-
-
- - - - - - - - - - - - -
- - - - -
-
-
-
-
-
-
-
-
+

Raw Message

@@ -268,30 +241,7 @@

-