performers = new HashSet<>();
25 | ObservationPerformer performer = new ObservationPerformer();
26 | performer.setPerformerType(ObservationPerformer.performer.Patient);
27 | performers.add(performer);
28 | observationEntity.setPerformers(performers);
29 | return observationEntity;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/java/uk/nhs/careconnect/ri/database/daointerface/transforms/builder/OrganisationEntityBuilder.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.daointerface.transforms.builder;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.organization.OrganisationEntity;
4 |
5 | public class OrganisationEntityBuilder {
6 |
7 | public static final long DEFAULT_ID = 310111L;
8 |
9 | private String name;
10 |
11 | public OrganisationEntity build(){
12 | OrganisationEntity organisationEntity = new OrganisationEntity();
13 | organisationEntity.setId(DEFAULT_ID);
14 | organisationEntity.setActive(true);
15 | if (name != null){
16 | organisationEntity.setName(name);
17 | }
18 |
19 | return organisationEntity;
20 | }
21 |
22 | }
23 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/java/uk/nhs/careconnect/ri/database/jpatest/JPATestIT.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.jpatest;
2 |
3 | import cucumber.api.CucumberOptions;
4 | import cucumber.api.junit.Cucumber;
5 | import org.junit.runner.RunWith;
6 |
7 | @RunWith(Cucumber.class)
8 | @CucumberOptions(
9 | glue={"uk.nhs.careconnect","cucumber.api.spring"},
10 | features = "classpath:cucumber/"
11 | )
12 | public class JPATestIT {
13 |
14 |
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/OtherCucumber/JPAImmunisationPostTest.feature:
--------------------------------------------------------------------------------
1 | Feature: Immunisation Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: Immunisation Patient
5 | Given I have one Immunisation resource loaded
6 | When I search Immunisation on Patient ID = 2
7 | Then I should get a Bundle of Immunisation 1 resource
8 | And the results should be a list of CareConnect Immunizations
9 |
10 | Scenario: Immunisation Patient Conditional
11 | Given I have one Immunisation resource loaded
12 | When I update this Immunisation
13 | Then I search Immunisation on Patient ID = 2
14 | Then I should get a Bundle of Immunisation 0 resource
15 | Then I search Immunisation on Patient ID = 3
16 | Then I should get a Bundle of Immunisation 1 resource
17 | And the results should be a list of CareConnect Immunizations
18 |
19 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/OtherCucumber/JPAMedicationRequestPostTest.feature:
--------------------------------------------------------------------------------
1 | Feature: MedicationRequest Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: MedicationRequest Patient
5 | Given I have one MedicationRequest resource loaded
6 | When I search MedicationRequest on Patient ID = 2
7 | Then I should get a Bundle of MedicationRequest 1 resource
8 | And the results should be a list of CareConnect MedicationRequests
9 |
10 | Scenario: MedicationRequest Patient Conditional
11 | Given I have one MedicationRequest resource loaded
12 | When I update this MedicationRequest
13 | Then I search MedicationRequest on Patient ID = 2
14 | Then I should get a Bundle of MedicationRequest 0 resource
15 | Then I search MedicationRequest on Patient ID = 3
16 | Then I should get a Bundle of MedicationRequest 1 resource
17 | And the results should be a list of CareConnect MedicationRequests
18 |
19 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | logging.level.org.springframework.web=INFO
2 | logging.level.org.hibernate=INFO
3 | datasource.cleardown.cron=0 19 21 * * *
4 | datasource.showSql=false
5 | datasource.showDdl=false
6 | datasource.vendor=h2
7 | datasource.path=db1;MODE=PostgreSQL
8 | datasource.host=mem
9 | datasource.driver:org.h2.Driver
10 | datasource.dialect=org.hibernate.dialect.H2Dialect
11 | datasource.username=fhirjpa
12 | datasource.password=fhirjpa
13 | flyway.locations=db/common
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPAAllergyIntolerancePostTest.feature:
--------------------------------------------------------------------------------
1 | Feature: AllergyIntolerance Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: AllergyIntolerance Patient
5 | Given I have one AllergyIntolerance resource loaded
6 | When I search AllergyIntolerance on Patient ID = 1
7 | Then I should get a Bundle of AllergyIntolerance 1 resource
8 |
9 | Scenario: AllergyIntolerance Patient Conditional
10 | Given I have one AllergyIntolerance resource loaded
11 | When I update this AllergyIntolerance
12 | Then I search AllergyIntolerance on Patient ID = 1
13 | Then I should get a Bundle of AllergyIntolerance 0 resource
14 |
15 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPACarePlanPostTest.feature:
--------------------------------------------------------------------------------
1 | Feature: CarePlan Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: CarePlan Patient
5 | Given I have one CarePlan resource loaded
6 | When I search CarePlan on Patient ID = 1
7 | Then I should get a Bundle of CarePlan 1 resource
8 |
9 |
10 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPACodeSystem.feature:
--------------------------------------------------------------------------------
1 | Feature: CodeSystem JPA Test
2 | As a client FHIR system
3 |
4 | Scenario: CodeSystem
5 | Given I add a dummy codesystem
6 | Then the CodeSystem should save
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPAConditionPostTest.feature:
--------------------------------------------------------------------------------
1 | Feature: Condition Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: Condition Patient
5 | Given I have one Condition resource loaded
6 | When I search Condition on Patient ID = 1
7 | Then I should get a Bundle of Condition 1 resource
8 | And the results should be a list of CareConnect Conditions
9 |
10 | Scenario: Condition Patient Conditional
11 | Given I have one Condition resource loaded
12 | When I update this Condition
13 | Then I search Condition on Patient ID = 1
14 | Then I should get a Bundle of Condition 1 resource
15 | And the results should be a list of CareConnect Conditions
16 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPADocumentReferenceTest.feature:
--------------------------------------------------------------------------------
1 | Feature: DocumentReference Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: DocumentReference Patient
5 | Given I have one DocumentReference resource loaded
6 | When I get DocumentReference ID = 1
7 | Then I should get a DocumentReference resource
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPAEncounterPostTest.feature:
--------------------------------------------------------------------------------
1 | Feature: Encounter Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: Encounter Patient
5 | Given I have one Encounter resource loaded
6 | When I search Encounter on Patient ID = 1
7 | Then I should get a Bundle of Encounter 1 resource
8 |
9 | Scenario: Encounter Patient Conditional
10 | Given I have one Encounter resource loaded
11 | When I update this Encounter
12 | Then I search Encounter on Patient ID = 1
13 | Then I should get a Bundle of Encounter 1 resource
14 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPAListPostTest.feature:
--------------------------------------------------------------------------------
1 | Feature: List Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: List Patient
5 | Given I have one List resource loaded
6 | When I search List on Patient ID = 1
7 | Then I should get a Bundle of List 1 resource
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPAMedicationStatemetTest.feature:
--------------------------------------------------------------------------------
1 | Feature: MedicationStatement Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: MedicationStatement Patient
5 | Given I have one MedicationStatement resource loaded
6 | When I get MedicationStatement ID = 1
7 | Then I should get a MedicationStatement resource
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPAObservationPatientSearchTest.feature:
--------------------------------------------------------------------------------
1 | Feature: Observation Integration Test
2 | As a client FHIR system
3 |
4 |
5 |
6 | Scenario: Observation Search Patient
7 | Given I have two sample resources loaded
8 | When I search on Patient ID = 1
9 | Then I should get a Bundle of Observations with more then 2 resources
10 |
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPAPractitionerRoleTest.feature:
--------------------------------------------------------------------------------
1 | Feature: PractitionerRole Test
2 | As a client FHIR system
3 | I want to work with Practitioner Roles
4 |
5 | Scenario: PractitionerRole Load
6 | Given PractitionerRole resource file
7 | Then save the PractitionerRole
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPAProcedurePostTest.feature:
--------------------------------------------------------------------------------
1 | Feature: Procedure Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: Procedure Patient
5 | Given I have one Procedure resource loaded
6 | When I search Procedure on Patient ID = 1
7 | Then I should get a Bundle of Procedure 1 resource
8 |
9 | Scenario: Procedure Patient Conditional
10 | Given I have one Procedure resource loaded
11 | When I update this Procedure
12 | Then I search Procedure on Patient ID = 1
13 | Then I should get a Bundle of Procedure 1 resource
14 |
15 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPAQuestionnaireResponsePostTest.feature:
--------------------------------------------------------------------------------
1 | Feature: QuestionnaireResponse Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: QuestionnaireResponse Patient
5 | Given I have one QuestionnaireResponse resource loaded
6 | When I search QuestionnaireResponse on Patient ID = 1
7 | Then I should get a Bundle of QuestionnaireResponse 1 resource
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPARiskAssessmentPostTest.feature:
--------------------------------------------------------------------------------
1 | Feature: RiskAssessment Integration Test
2 | As a client FHIR system
3 |
4 | Scenario: RiskAssessment Patient
5 | Given I have one RiskAssessment resource loaded
6 | When I search RiskAssessment on Patient ID = 1
7 | Then I should get a Bundle of RiskAssessment 1 resource
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/cucumber/JPAValueSetTest.feature:
--------------------------------------------------------------------------------
1 | Feature: ValueSet
2 |
3 |
4 | Scenario: ValueSet Read
5 | Given I add a ValueSet with an Id of CareConnect-EthnicCategory-1
6 | Then the result should be a FHIR ValueSet
7 |
8 | Scenario: ValueSet Read
9 | Given I add a ValueSet with an Id of CareConnect-AllergySeverity-1
10 | Then the result should be a FHIR ValueSet
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/AllergyIntoleranceExample.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "AllergyIntolerance",
3 | "identifier": [
4 | {
5 | "system": "https://fhir.leedsth.nhs.uk/Id/allergy",
6 | "value": "100021"
7 | }
8 | ],
9 | "clinicalStatus": "active",
10 | "verificationStatus": "confirmed",
11 | "code": {
12 | "coding": [
13 | {
14 | "system": "http://snomed.info/sct",
15 | "code": "722071008",
16 | "display": "Mould antigen"
17 | }
18 | ]
19 | },
20 | "patient": {
21 | "reference": "Patient/1"
22 | },
23 | "assertedDate": "2017-04-13T00:00:00+01:00",
24 | "asserter": {
25 | "reference": "Practitioner/3"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/AllergyIntoleranceExampleTwo.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "AllergyIntolerance",
3 | "identifier": [
4 | {
5 | "system": "https://fhir.leedsth.nhs.uk/Id/allergy",
6 | "value": "100021"
7 | }
8 | ],
9 | "clinicalStatus": "active",
10 | "verificationStatus": "confirmed",
11 | "code": {
12 | "coding": [
13 | {
14 | "system": "http://snomed.info/sct",
15 | "code": "722071008",
16 | "display": "Mould antigen"
17 | }
18 | ]
19 | },
20 | "patient": {
21 | "reference": "Patient/2"
22 | },
23 | "assertedDate": "2017-04-13T00:00:00+01:00",
24 | "asserter": {
25 | "reference": "Practitioner/3"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/ConditionExample.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Condition",
3 | "identifier": [
4 | {
5 | "system": "https://fhir.leedsth.nhs.uk/Id/condition",
6 | "value": "10025"
7 | }
8 | ],
9 | "clinicalStatus": "remission",
10 | "verificationStatus": "confirmed",
11 | "category": [
12 | {
13 | "coding": [
14 | {
15 | "system": "http://hl7.org/fhir/condition-category",
16 | "code": "encounter-diagnosis",
17 | "display": "Encounter Diagnosis"
18 | }
19 | ]
20 | }
21 | ],
22 | "severity": {
23 | "coding": [
24 | {
25 | "system": "http://snomed.info/sct",
26 | "code": "24484000",
27 | "display": "Severe"
28 | }
29 | ]
30 | },
31 | "code": {
32 | "coding": [
33 | {
34 | "system": "http://snomed.info/sct",
35 | "code": "73430006",
36 | "display": "Sleep Apnea"
37 | }
38 | ]
39 | },
40 | "subject": {
41 | "reference": "Patient/1"
42 | },
43 | "context": {
44 | "reference": "Encounter/1"
45 | },
46 | "assertedDate": "2017-06-27T00:00:00+01:00",
47 | "asserter": {
48 | "reference": "Practitioner/3"
49 | }
50 | }
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/ConditionExampleTwo.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Condition",
3 | "identifier": [
4 | {
5 | "system": "https://fhir.leedsth.nhs.uk/Id/condition",
6 | "value": "10025"
7 | }
8 | ],
9 | "clinicalStatus": "remission",
10 | "verificationStatus": "confirmed",
11 | "category": [
12 | {
13 | "coding": [
14 | {
15 | "system": "http://hl7.org/fhir/condition-category",
16 | "code": "encounter-diagnosis",
17 | "display": "Encounter Diagnosis"
18 | }
19 | ]
20 | }
21 | ],
22 | "severity": {
23 | "coding": [
24 | {
25 | "system": "http://snomed.info/sct",
26 | "code": "24484000",
27 | "display": "Severe"
28 | }
29 | ]
30 | },
31 | "code": {
32 | "coding": [
33 | {
34 | "system": "http://snomed.info/sct",
35 | "code": "73430006",
36 | "display": "Sleep Apnea"
37 | }
38 | ]
39 | },
40 | "subject": {
41 | "reference": "Patient/2"
42 | },
43 | "context": {
44 | "reference": "Encounter/1"
45 | },
46 | "assertedDate": "2017-06-27T00:00:00+01:00",
47 | "asserter": {
48 | "reference": "Practitioner/3"
49 | }
50 | }
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/EncounterExample.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Encounter",
3 | "meta": {
4 | "profile": [
5 | "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Encounter-1"
6 | ]
7 | },
8 | "identifier": [
9 | {
10 | "system": "https://fhir.leedsth.nhs.uk/Id/encounter",
11 | "value": "1"
12 | }
13 | ],
14 | "status": "arrived",
15 | "subject": {
16 | "reference": "Patient/1"
17 | },
18 | "participant": [
19 | {
20 | "type": [
21 | {
22 | "coding": [
23 | {
24 | "system": "http://hl7.org/fhir/ValueSet/encounter-participant-type",
25 | "code": "PPRF"
26 | }
27 | ]
28 | }
29 | ],
30 | "individual": {
31 | "reference": "Practitioner/3"
32 | }
33 | }
34 | ],
35 | "period": {
36 | "start": "2017-10-19T16:47:10+01:00",
37 | "end": "2017-10-19T00:00:00+01:00"
38 | }
39 | }
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/EncounterExampleTwo.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Encounter",
3 | "meta": {
4 | "profile": [
5 | "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Encounter-1"
6 | ]
7 | },
8 | "identifier": [
9 | {
10 | "system": "https://fhir.leedsth.nhs.uk/Id/encounter",
11 | "value": "1"
12 | }
13 | ],
14 | "status": "arrived",
15 | "subject": {
16 | "reference": "Patient/3"
17 | },
18 | "participant": [
19 | {
20 | "type": [
21 | {
22 | "coding": [
23 | {
24 | "system": "http://hl7.org/fhir/ValueSet/encounter-participant-type",
25 | "code": "PPRF"
26 | }
27 | ]
28 | }
29 | ],
30 | "individual": {
31 | "reference": "Practitioner/3"
32 | }
33 | }
34 | ],
35 | "period": {
36 | "start": "2017-10-19T16:47:10+01:00",
37 | "end": "2017-10-19T00:00:00+01:00"
38 | }
39 | }
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/HealthcareService.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "HealthcareService",
3 | "meta": {
4 | "profile": [
5 | "https://fhir.nhs.uk/STU3/StructureDefinition/DCH-HealthcareService-1"
6 | ]
7 | },
8 | "identifier": [
9 | {
10 | "system": "https://tools.ietf.org/html/rfc4122",
11 | "value": "2db9a96b-393f-4817-868f-3e064296f1f9"
12 | }
13 | ],
14 | "providedBy": {
15 | "reference": "Organization/1"
16 | },
17 | "specialty": [
18 | {
19 | "coding": [
20 | {
21 | "system": "http://snomed.info/sct",
22 | "code": "408470005"
23 | }
24 | ]
25 | }
26 | ],
27 | "location": [
28 | {
29 | "reference": "Location/1"
30 | }
31 | ],
32 | "telecom": [
33 | {
34 | "system": "phone",
35 | "value": "0191 1231234"
36 | }
37 | ]
38 | }
39 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/ImmunisationExample.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Immunization",
3 | "extension": [
4 | {
5 | "url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-DateRecorded-1",
6 | "valueDateTime": "1998-01-06T00:00:00+00:00"
7 | },
8 | {
9 | "url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-ParentPresent-1",
10 | "valueBoolean": false
11 | }
12 | ],
13 | "identifier": [
14 | {
15 | "system": "https://fhir.leedsth.nhs.uk/Id/immunisation",
16 | "value": "268435496"
17 | }
18 | ],
19 | "status": "completed",
20 | "notGiven": false,
21 | "vaccineCode": {
22 | "coding": [
23 | {
24 | "system": "http://snomed.info/sct",
25 | "code": "308081000000105",
26 | "display": "MMR"
27 | }
28 | ]
29 | },
30 | "patient": {
31 | "reference": "Patient/2"
32 | },
33 | "primarySource": true,
34 | "reportOrigin": {
35 | "coding": [
36 | {
37 | "system": "http://hl7.org/fhir/immunization-origin",
38 | "code": "provider",
39 | "display": "Provider"
40 | }
41 | ]
42 | },
43 | "location": {
44 | "reference": "Location/1"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/ImmunisationExampleTwo.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Immunization",
3 | "extension": [
4 | {
5 | "url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-DateRecorded-1",
6 | "valueDateTime": "1998-01-06T00:00:00+00:00"
7 | },
8 | {
9 | "url": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-ParentPresent-1",
10 | "valueBoolean": false
11 | }
12 | ],
13 | "identifier": [
14 | {
15 | "system": "https://fhir.leedsth.nhs.uk/Id/immunisation",
16 | "value": "268435496"
17 | }
18 | ],
19 | "status": "completed",
20 | "notGiven": false,
21 | "vaccineCode": {
22 | "coding": [
23 | {
24 | "system": "http://snomed.info/sct",
25 | "code": "308081000000105",
26 | "display": "MMR"
27 | }
28 | ]
29 | },
30 | "patient": {
31 | "reference": "Patient/3"
32 | },
33 | "primarySource": true,
34 | "reportOrigin": {
35 | "coding": [
36 | {
37 | "system": "http://hl7.org/fhir/immunization-origin",
38 | "code": "provider",
39 | "display": "Provider"
40 | }
41 | ]
42 | },
43 | "location": {
44 | "reference": "Location/1"
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/ProcedureExample.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Procedure",
3 | "identifier": [
4 | {
5 | "system": "https://fhir.leedsth.nhs.uk/Id/procedure",
6 | "value": "100012"
7 | }
8 | ],
9 | "status": "completed",
10 | "notDone": false,
11 | "category": {
12 | "coding": [
13 | {
14 | "system": "http://snomed.info/sct",
15 | "code": "409073007",
16 | "display": "Education"
17 | }
18 | ]
19 | },
20 | "code": {
21 | "coding": [
22 | {
23 | "system": "http://snomed.info/sct",
24 | "code": "284350006",
25 | "display": "Diabetes mellitus diet education "
26 | }
27 | ]
28 | },
29 | "subject": {
30 | "reference": "Patient/1"
31 | },
32 | "context": {
33 | "reference": "Encounter/1"
34 | },
35 | "performedDateTime": "2017-03-19T00:00:00+00:00",
36 | "performer": [
37 | {
38 | "actor": {
39 | "reference": "Practitioner/1"
40 | }
41 | }
42 | ],
43 | "outcome": {
44 | "coding": [
45 | {
46 | "system": "http://snomed.info/sct",
47 | "code": "385669000",
48 | "display": "successful"
49 | }
50 | ]
51 | }
52 | }
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/ProcedureExampleTwo.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Procedure",
3 | "identifier": [
4 | {
5 | "system": "https://fhir.leedsth.nhs.uk/Id/procedure",
6 | "value": "100012"
7 | }
8 | ],
9 | "status": "completed",
10 | "notDone": false,
11 | "category": {
12 | "coding": [
13 | {
14 | "system": "http://snomed.info/sct",
15 | "code": "409073007",
16 | "display": "Education"
17 | }
18 | ]
19 | },
20 | "code": {
21 | "coding": [
22 | {
23 | "system": "http://snomed.info/sct",
24 | "code": "284350006",
25 | "display": "Diabetes mellitus diet education "
26 | }
27 | ]
28 | },
29 | "subject": {
30 | "reference": "Patient/2"
31 | },
32 | "context": {
33 | "reference": "Encounter/2"
34 | },
35 | "performedDateTime": "2017-03-19T00:00:00+00:00",
36 | "performer": [
37 | {
38 | "actor": {
39 | "reference": "Practitioner/2"
40 | }
41 | }
42 | ],
43 | "outcome": {
44 | "coding": [
45 | {
46 | "system": "http://snomed.info/sct",
47 | "code": "385669000",
48 | "display": "successful"
49 | }
50 | ]
51 | }
52 | }
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/Social-History-SmokingStatus.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType":"Observation",
3 | "meta":{
4 | "versionId":"1",
5 | "lastUpdated":"2016-03-19T19:48:22Z"
6 | },
7 | "text":{
8 | "status":"generated",
9 | "div":"Tobacco smoking status: Current some day smoker
"
10 | },
11 | "status":"final",
12 | "category":{
13 | "coding":[
14 | {
15 | "system":"http://snomed.info/sct",
16 | "code":"228272008",
17 | "display":"Health-related behavior"
18 | }
19 | ],
20 | "text":"Social History"
21 | },
22 | "code":{
23 | "coding":[
24 | {
25 | "system":"http://snomed.info/sct",
26 | "code":"229819007",
27 | "display":"Tobacco use and exposure"
28 | }
29 | ],
30 | "text":"Tobacco smoking status"
31 | },
32 | "subject":{
33 | "reference":"Patient/1"
34 | },
35 | "effectiveDateTime": "1999-08-03",
36 | "performer": {
37 | "reference": "Patient/1"
38 | },
39 | "issued":"2016-03-18T05:27:04Z",
40 | "valueCodeableConcept":{
41 | "coding":[
42 | {
43 | "system":"http://snomed.info/sct",
44 | "code":"428041000124106",
45 | "display":"Current some day smoker"
46 | }
47 | ],
48 | "text":"Current some day smoker"
49 | }
50 | }
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/Vital-Body-Mass-Example.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Observation",
3 | "meta": {
4 | "versionId": "4171",
5 | "lastUpdated": "2016-03-09T15:30:09.143+00:00"
6 | },
7 | "text": {
8 | "status": "generated",
9 | "div": "1999-07-02: bmi = 16.2 kg/m2
"
10 | },
11 | "status": "final",
12 | "category": {
13 | "coding": [
14 | {
15 | "system":"http://snomed.info/sct",
16 | "code":"365605003",
17 | "display":"Body measurement finding"
18 | }
19 | ],
20 | "text": "Vital Signs"
21 | },
22 | "code": {
23 | "coding": [
24 | {
25 | "system": "http://snomed.info/sct",
26 | "code": "301331008",
27 | "display": "Observation of body mass index"
28 | }
29 | ],
30 | "text": "bmi"
31 | },
32 | "subject": {
33 | "reference": "Patient/1"
34 | },
35 | "effectiveDateTime": "1999-07-02",
36 | "performer": {
37 | "reference": "Practitioner/1"
38 | },
39 | "valueQuantity": {
40 | "value": 16.2,
41 | "unit": "kg/m2",
42 | "system": "http://unitsofmeasure.org",
43 | "code": "kg/m2"
44 | }
45 | }
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/json/observationExample.json:
--------------------------------------------------------------------------------
1 | {
2 | "resourceType": "Observation",
3 | "status": "final",
4 | "category": [
5 | {
6 | "coding": [
7 | {
8 | "system": "http://hl7.org/fhir/observation-category",
9 | "code": "vital-signs",
10 | "display": "vital-signs"
11 | }
12 | ]
13 | }
14 | ],
15 | "code": {
16 | "coding": [
17 | {
18 | "system": "http://snomed.info/sct",
19 | "code": "86290005",
20 | "display": "Respiratory rate"
21 | }
22 | ]
23 | },
24 | "subject": {
25 | "reference": "Patient/1"
26 | },
27 | "effectiveDateTime": "2015-12-03T13:30:00+00:00",
28 | "performer": [
29 | {
30 | "reference": "Practitioner/1"
31 | }
32 | ],
33 | "valueQuantity": {
34 | "value": 16,
35 | "unit": "/min",
36 | "system": "http://unitsofmeasure.org",
37 | "code": "/min"
38 | },
39 | "referenceRange": [
40 | {
41 | "low": {
42 | "value": 12
43 | },
44 | "high": {
45 | "value": 18
46 | }
47 | }
48 | ]
49 | }
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/loinc/LOINC_2.54_MULTI-AXIAL_HIERARCHY.CSV:
--------------------------------------------------------------------------------
1 | PATH_TO_ROOT,SEQUENCE,IMMEDIATE_PARENT,CODE,CODE_TEXT
2 | ,1,,LP31755-9,Microbiology
3 | LP31755-9,1,LP31755-9,LP14559-6,Microorganism
4 | LP31755-9.LP14559-6,1,LP14559-6,LP98185-9,Bacteria
5 | LP31755-9.LP14559-6.LP98185-9,1,LP98185-9,LP14082-9,Bacteria
6 | LP31755-9.LP14559-6.LP98185-9.LP14082-9,1,LP14082-9,LP52258-8,Bacteria | Body Fluid
7 | LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52258-8,1,LP52258-8,41599-2,Bacteria Fld Ql Micro
8 | LP31755-9.LP14559-6.LP98185-9.LP14082-9,2,LP14082-9,LP52260-4,Bacteria | Cerebral spinal fluid
9 | LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52260-4,1,LP52260-4,41602-4,Bacteria CSF Ql Micro
10 | LP31755-9.LP14559-6.LP98185-9.LP14082-9,3,LP14082-9,LP52960-9,Bacteria | Cervix
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/sct/sct2_Concept_Full-en_INT_20160131.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nhsconnect/careconnect-reference-implementation/6965c161c8df185b7fa785b4282fdf01166dbaa7/ccri-dao-stu3/src/test/resources/sct/sct2_Concept_Full-en_INT_20160131.txt
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/sct/sct2_Concept_Full_INT_20160131.txt:
--------------------------------------------------------------------------------
1 | id effectiveTime active moduleId definitionStatusId
2 | 100005 20020131 0 900000000000207008 900000000000074008
3 | 101009 20020131 1 900000000000207008 900000000000074008
4 | 102002 20020131 1 900000000000207008 900000000000074008
5 | 103007 20020131 1 900000000000207008 900000000000074008
6 | 104001 20020131 1 900000000000207008 900000000000073002
7 | 105000 20020131 1 900000000000207008 900000000000074008
8 | 105000 20040731 0 900000000000207008 900000000000074008
9 | 106004 20020131 1 900000000000207008 900000000000074008
10 | 107008 20020131 1 900000000000207008 900000000000074008
11 | 116680003 20020131 1 900000000000207008 900000000000074008
12 | 126815003 20020131 1 900000000000207008 900000000000074008
13 | 126813005 20020131 1 900000000000207008 900000000000074008
14 | 126813006 20020131 1 900000000000207008 900000000000074008
15 | 126817006 20020131 1 900000000000207008 900000000000074008
16 | 126816002 20020131 1 900000000000207008 900000000000074008
17 | 207527008 20020131 1 900000000000207008 900000000000074008
18 | 207527008 20040731 1 900000000000207008 900000000000073002
19 | 207527008 20090731 0 900000000000207008 900000000000074008
20 | 404684003 20040131 1 900000000000207008 900000000000074008
21 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/sct/sct2_Identifier_Full_INT_20160131.txt:
--------------------------------------------------------------------------------
1 | identifierSchemeId alternateIdentifier effectiveTime active moduleId referencedComponentId
2 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/sct/sct2_Relationship_Full_INT_20160131.txt:
--------------------------------------------------------------------------------
1 | id effectiveTime active moduleId sourceId destinationId relationshipGroup typeId characteristicTypeId modifierId
2 | 100022 20020131 1 900000000000207008 126815003 126813005 0 116680003 900000000000011006 900000000000451002
3 | 100025 20020131 1 900000000000207008 126816002 126813005 0 116680003 900000000000011006 900000000000451002
4 | 100025 20090731 0 900000000000207008 126816002 126813005 0 116680003 900000000000011006 900000000000451002
5 | 101021 20020131 1 900000000000207008 126817006 126815003 0 116680003 900000000000011006 900000000000451002
6 | 101021 20020131 1 900000000000207008 126815003 126817006 0 116680003 900000000000011006 900000000000451002
7 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/sct/sct2_StatedRelationship_Full_INT_20160131.txt:
--------------------------------------------------------------------------------
1 | id effectiveTime active moduleId sourceId destinationId relationshipGroup typeId characteristicTypeId modifierId
2 | 3187444026 20140131 1 900000000000207008 425630003 400195000 0 42752001 900000000000010007 900000000000451002
3 | 3187444026 20160131 0 900000000000207008 425630003 400195000 0 42752001 900000000000010007 900000000000451002
4 | 3192499027 20140131 0 900000000000207008 425630003 105590001 0 246075003 900000000000010007 900000000000451002
5 | 3574321020 20140131 1 900000000000207008 425630003 111189002 0 116680003 900000000000010007 900000000000451002
6 | 3574321020 20160131 0 900000000000207008 425630003 111189002 0 116680003 900000000000010007 900000000000451002
7 | 3829433029 20080731 1 900000000000207008 102977005 102976001 0 116680003 900000000000010007 900000000000451002
8 | 3829434024 20080731 1 900000000000207008 413337008 306751006 0 116680003 900000000000010007 900000000000451002
9 | 3829435020 20080731 1 900000000000207008 103085008 72909000 0 116680003 900000000000010007 900000000000451002
10 | 3829436021 20080731 1 900000000000207008 103085008 259648002 0 116680003 900000000000010007 900000000000451002
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/sct/sct2_TextDefinition_Full-en_INT_20160131.txt:
--------------------------------------------------------------------------------
1 | id effectiveTime active moduleId conceptId languageCode typeId term caseSignificanceId
2 | 2884452019 20040731 1 900000000000207008 410016009 en 900000000000550004 A decrease in lower leg circumference due to recurrent ulceration and fat necrosis causing loss of subcutaneous tissue in a patient with venous stasis disease 900000000000017005
3 | 2884453012 20050731 1 900000000000207008 416118004 en 900000000000550004 Introduction of a substance to the body 900000000000017005
4 | 2884454018 20030731 1 900000000000207008 125097000 en 900000000000550004 Domestic goat 900000000000017005
5 | 2884455017 20030731 1 900000000000207008 125099002 en 900000000000550004 Domestic sheep species 900000000000017005
6 | 2884455017 20110131 0 900000000000207008 125099002 en 900000000000550004 Domestic sheep species 900000000000017005
7 | 2884456016 20030731 1 900000000000207008 122868007 en 900000000000550004 An implantation of a staple 900000000000017005
8 | 2884457013 20030731 1 900000000000207008 125085001 en 900000000000550004 Equus subspecies 900000000000017005
9 | 2884457013 20100731 0 900000000000207008 125085001 en 900000000000550004 Equus subspecies 900000000000017005
10 | 2884458015 20030731 1 900000000000207008 125671007 en 900000000000550004 Disruption of continuity of tissue, not necessarily due to external forces; may be due to weakness in the tissue or excessive internal pressures 900000000000017005
11 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/CarePlan.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/ClinicalImpression.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/Consent.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/List.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | -
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/Location.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/MedicationStatement.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/Observation.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/Practitioner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/PractitionerRole.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/RelatedPerson.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/ccri-dao-stu3/src/test/resources/xml/RiskAssessment.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/ccri-database/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//src/main/java=UTF-8
3 | encoding//src/main/resources=UTF-8
4 | encoding//src/test/java=UTF-8
5 | encoding//src/test/resources=UTF-8
6 | encoding/=UTF-8
7 |
--------------------------------------------------------------------------------
/ccri-database/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
3 | org.eclipse.jdt.core.compiler.compliance=1.8
4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5 | org.eclipse.jdt.core.compiler.source=1.8
6 |
--------------------------------------------------------------------------------
/ccri-database/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/ccri-database/.settings/org.eclipse.wst.common.project.facet.core.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ccri-database/.settings/org.hibernate.eclipse.console.prefs:
--------------------------------------------------------------------------------
1 | default.configuration=ccri-database
2 | eclipse.preferences.version=1
3 | hibernate3.enabled=true
4 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/daointerface/BaseR4Repository.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.daointerface;
2 |
3 | import ca.uhn.fhir.context.FhirContext;
4 | import org.hl7.fhir.r4.model.DomainResource;
5 | import org.hl7.fhir.r4.model.IdType;
6 | import uk.nhs.careconnect.fhir.OperationOutcomeException;
7 | import uk.nhs.careconnect.ri.database.entity.IBaseResource;
8 |
9 |
10 | public interface BaseR4Repository {
11 |
12 | Long count();
13 |
14 | R readEntity(FhirContext ctx, IdType theId);
15 |
16 | void save(FhirContext ctx, R resource) throws OperationOutcomeException;
17 |
18 | F read(FhirContext ctx, IdType theId);
19 | }
20 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/daointerface/BaseRepository.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.daointerface;
2 |
3 | import ca.uhn.fhir.context.FhirContext;
4 | import org.hl7.fhir.dstu3.model.DomainResource;
5 | import org.hl7.fhir.dstu3.model.IdType;
6 | import uk.nhs.careconnect.fhir.OperationOutcomeException;
7 | import uk.nhs.careconnect.ri.database.entity.IBaseResource;
8 |
9 |
10 | public interface BaseRepository {
11 |
12 | Long count();
13 |
14 | R readEntity(FhirContext ctx, IdType theId);
15 |
16 | void save(FhirContext ctx, R resource) throws OperationOutcomeException;
17 |
18 | F read(FhirContext ctx, IdType theId);
19 | }
20 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/daointerface/GraphDefinitionRepository.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.daointerface;
2 |
3 | import ca.uhn.fhir.context.FhirContext;
4 | import ca.uhn.fhir.rest.annotation.OptionalParam;
5 | import ca.uhn.fhir.rest.param.StringParam;
6 | import ca.uhn.fhir.rest.param.TokenParam;
7 | import ca.uhn.fhir.rest.param.UriParam;
8 | import org.hl7.fhir.dstu3.model.IdType;
9 | import org.hl7.fhir.dstu3.model.GraphDefinition;
10 | import uk.nhs.careconnect.fhir.OperationOutcomeException;
11 | import uk.nhs.careconnect.ri.database.entity.graphDefinition.GraphDefinitionEntity;
12 | import uk.nhs.careconnect.ri.database.entity.graphDefinition.GraphDefinitionEntity;
13 |
14 | import java.util.List;
15 |
16 |
17 | public interface GraphDefinitionRepository extends BaseRepository {
18 |
19 |
20 | void save(FhirContext ctx, GraphDefinitionEntity valueset);
21 |
22 | GraphDefinition create(FhirContext ctx, GraphDefinition graphDefinition) throws OperationOutcomeException;
23 |
24 | GraphDefinition read(FhirContext ctx, IdType theId) ;
25 |
26 | List search(FhirContext ctx,
27 | @OptionalParam(name = GraphDefinition.SP_NAME) StringParam name,
28 | @OptionalParam(name = GraphDefinition.SP_PUBLISHER) StringParam publisher,
29 | @OptionalParam(name = GraphDefinition.SP_URL) UriParam url
30 |
31 | );
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/daointerface/ISearchResultDao.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.daointerface;
2 |
3 | import ca.uhn.fhir.rest.api.server.IBundleProvider;
4 |
5 | public interface ISearchResultDao {
6 |
7 | String save(IBundleProvider searchResults);
8 |
9 | IBundleProvider read(String searchId);
10 | }
11 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/daointerface/ITask.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.daointerface;
2 |
3 | import ca.uhn.fhir.context.FhirContext;
4 | import ca.uhn.fhir.rest.param.ReferenceParam;
5 | import org.hl7.fhir.dstu3.model.IdType;
6 | import org.hl7.fhir.dstu3.model.Task;
7 |
8 | import java.util.List;
9 |
10 | public interface ITask {
11 |
12 | Task read(FhirContext ctx, IdType internalId);
13 |
14 | Task create(FhirContext ctx, Task task);
15 |
16 | List search(FhirContext ctx, ReferenceParam patient) throws Exception;
17 |
18 | }
19 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/daointerface/TerminologyLoader.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.daointerface;
2 |
3 | import ca.uhn.fhir.rest.api.server.RequestDetails;
4 | import uk.nhs.careconnect.fhir.OperationOutcomeException;
5 | import uk.nhs.careconnect.ri.database.entity.codeSystem.CodeSystemEntity;
6 |
7 | import java.util.List;
8 |
9 | public interface TerminologyLoader {
10 | String LOINC_URL = "http://loinc.org";
11 | String SCT_URL = "http://snomed.info/sct";
12 |
13 | UploadStatistics loadLoinc(List theZipBytes, RequestDetails theRequestDetails) throws OperationOutcomeException;
14 |
15 | UploadStatistics loadSnomedCt(List theZipBytes, RequestDetails theRequestDetails) throws OperationOutcomeException;
16 |
17 | void storeCodeSystem(RequestDetails theRequestDetails, final CodeSystemEntity codeSystemVersion) throws OperationOutcomeException;
18 |
19 | public static class UploadStatistics {
20 | private final int myConceptCount;
21 |
22 | public UploadStatistics(int theConceptCount) {
23 | myConceptCount = theConceptCount;
24 | }
25 |
26 | public int getConceptCount() {
27 | return myConceptCount;
28 | }
29 |
30 |
31 |
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/daointerface/ValueSetRepository.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.daointerface;
2 |
3 | import ca.uhn.fhir.context.FhirContext;
4 | import ca.uhn.fhir.rest.annotation.OptionalParam;
5 | import ca.uhn.fhir.rest.param.StringParam;
6 | import ca.uhn.fhir.rest.param.TokenParam;
7 | import ca.uhn.fhir.rest.param.UriParam;
8 | import org.hl7.fhir.dstu3.model.CodeSystem;
9 | import org.hl7.fhir.dstu3.model.IdType;
10 | import org.hl7.fhir.dstu3.model.ValueSet;
11 | import uk.nhs.careconnect.fhir.OperationOutcomeException;
12 | import uk.nhs.careconnect.ri.database.entity.valueSet.ValueSetEntity;
13 |
14 | import java.util.List;
15 |
16 |
17 | public interface ValueSetRepository extends BaseRepository {
18 |
19 |
20 |
21 | void save(FhirContext ctx, ValueSetEntity valueset);
22 |
23 |
24 | ValueSet create(FhirContext ctx,ValueSet valueSet) throws OperationOutcomeException;
25 |
26 | ValueSet read(FhirContext ctx,IdType theId) ;
27 |
28 | ValueSet readAndExpand(FhirContext ctx,IdType theId) throws OperationOutcomeException;
29 |
30 | List search (FhirContext ctx,
31 | @OptionalParam(name = ValueSet.SP_NAME) StringParam name,
32 | @OptionalParam(name = ValueSet.SP_PUBLISHER) StringParam publisher,
33 | @OptionalParam(name = ValueSet.SP_URL) UriParam url,
34 | @OptionalParam(name = ValueSet.SP_IDENTIFIER) TokenParam identifier
35 | );
36 |
37 | }
38 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/BaseAddress.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity;
2 |
3 |
4 | import org.hl7.fhir.dstu3.model.Address;
5 |
6 | import javax.persistence.EnumType;
7 | import javax.persistence.Enumerated;
8 | import javax.persistence.MappedSuperclass;
9 |
10 | @MappedSuperclass
11 | public abstract class BaseAddress extends BaseResource {
12 |
13 | @Enumerated(EnumType.ORDINAL)
14 | Address.AddressUse addressUse;
15 |
16 | @Enumerated(EnumType.ORDINAL)
17 | Address.AddressType addressType;
18 |
19 | public abstract AddressEntity getAddress();
20 |
21 | public abstract AddressEntity setAddress(AddressEntity addressEntity);
22 |
23 | public Address.AddressUse getAddressUse() {
24 | return addressUse;
25 | }
26 |
27 |
28 |
29 | public void setAddressUse(Address.AddressUse addressUse) {
30 | this.addressUse = addressUse;
31 | }
32 |
33 |
34 |
35 | public Address.AddressType getAddressType() {
36 | return addressType;
37 | }
38 |
39 |
40 |
41 | public void setAddressType(Address.AddressType addressType) {
42 | this.addressType = addressType;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/BaseCodeableConcept.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity;
2 |
3 |
4 | import uk.nhs.careconnect.ri.database.entity.codeSystem.ConceptEntity;
5 | import javax.persistence.*;
6 |
7 |
8 | @MappedSuperclass
9 | public class BaseCodeableConcept extends BaseResource {
10 |
11 | private static final int MAX_DESC_LENGTH = 4096;
12 |
13 | @Column(name = "CONCEPT_TEXT", length = MAX_DESC_LENGTH)
14 | private String conceptText;
15 |
16 | @ManyToOne(fetch = FetchType.LAZY)
17 | @JoinColumn(name = "CONCEPT_CODE")
18 | private ConceptEntity conceptCode;
19 |
20 | @Column(name = "listOrder")
21 | private Integer order;
22 |
23 | public static int getMaxDescLength() {
24 | return MAX_DESC_LENGTH;
25 | }
26 |
27 | public String getConceptText() {
28 | return conceptText;
29 | }
30 |
31 | public void setConceptText(String conceptText) {
32 | this.conceptText = conceptText;
33 | }
34 |
35 | public ConceptEntity getConceptCode() {
36 | return conceptCode;
37 | }
38 |
39 | public void setConceptCode(ConceptEntity conceptCode) {
40 | this.conceptCode = conceptCode;
41 | }
42 |
43 | public Integer getOrder() {
44 | return order;
45 | }
46 |
47 | public void setOrder(Integer order) {
48 | this.order = order;
49 | }
50 |
51 | @Override
52 | public Long getId() {
53 | return null;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/BaseContactPoint.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity;
2 |
3 | import org.hl7.fhir.dstu3.model.ContactPoint;
4 |
5 | import javax.persistence.Column;
6 | import javax.persistence.EnumType;
7 | import javax.persistence.Enumerated;
8 | import javax.persistence.MappedSuperclass;
9 |
10 |
11 | @MappedSuperclass
12 | public class BaseContactPoint extends BaseResource {
13 |
14 | @Column(name = "CONTACT_VALUE")
15 | private String value;
16 |
17 | @Column(name = "TELECOM_USE")
18 | @Enumerated(EnumType.ORDINAL)
19 | ContactPoint.ContactPointUse telecomUse;
20 |
21 | @Column(name = "SYSTEM_ID")
22 | @Enumerated(EnumType.ORDINAL)
23 | ContactPoint.ContactPointSystem system;
24 |
25 |
26 | public ContactPoint.ContactPointSystem getSystem() {
27 | return this.system;
28 | }
29 |
30 | public void setSystem(ContactPoint.ContactPointSystem systemEntity) {
31 | this.system = systemEntity;
32 | }
33 |
34 |
35 |
36 |
37 | public void setValue(String value) { this.value = value; }
38 | public String getValue() { return this.value; }
39 |
40 | public void setTelecomUse(ContactPoint.ContactPointUse use) { this.telecomUse = use; }
41 |
42 |
43 |
44 | public ContactPoint.ContactPointUse getTelecomUse() { return this.telecomUse; }
45 |
46 |
47 |
48 | @Override
49 | public Long getId() {
50 | return null;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/IBaseResource.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity;
2 |
3 | public interface IBaseResource {
4 |
5 | Long getId();
6 | }
7 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/Person/PersonIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.Person;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier2;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="PersonIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_PERSON_IDENTIFIER", columnNames={"PERSON_IDENTIFIER_ID"})
9 | ,indexes =
10 | {
11 | @Index(name = "IDX_MPIPERSON_IDENTIFER", columnList="IDENTIFIER_VALUE,NAMING_UNIQUE_ID")
12 | })
13 | public class PersonIdentifier extends BaseIdentifier2 {
14 |
15 | public PersonIdentifier() {
16 | }
17 | public PersonIdentifier(PersonEntity personEntity) {
18 | this.personEntity = personEntity;
19 | }
20 |
21 |
22 | @Id
23 | @GeneratedValue(strategy = GenerationType.IDENTITY)
24 | @Column(name= "PERSON_IDENTIFIER_ID")
25 | private Long identifierId;
26 |
27 | @ManyToOne(fetch = FetchType.LAZY)
28 | @JoinColumn (name = "PERSON_ID",foreignKey= @ForeignKey(name="FK_PERSON_PERSON_IDENTIFIER"))
29 | private PersonEntity personEntity;
30 |
31 |
32 | public Long getIdentifierId() { return identifierId; }
33 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
34 |
35 | public PersonEntity getPerson() {
36 | return this.personEntity;
37 | }
38 | public void setPerson(PersonEntity personEntity) {
39 | this.personEntity = personEntity;
40 | }
41 |
42 |
43 |
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/Person/PersonName.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.Person;
2 |
3 |
4 | import uk.nhs.careconnect.ri.database.entity.BaseHumanName;
5 |
6 | import javax.persistence.*;
7 |
8 | @Entity
9 | @Table(name = "PersonName",indexes =
10 | {
11 | @Index(name = "IDX_MPIPERSON_FAMILY", columnList="family_name")
12 | , @Index(name = "IDX_MPIPERSON_GIVEN", columnList="given_name")
13 | })
14 | public class PersonName extends BaseHumanName {
15 |
16 | @Id
17 | @GeneratedValue(strategy = GenerationType.IDENTITY)
18 | @Column(name="PERSON_NAME_ID")
19 | private Long myId;
20 |
21 |
22 | @ManyToOne(fetch = FetchType.LAZY)
23 | @JoinColumn(name = "PERSON_ID",foreignKey= @ForeignKey(name="FK_PERSON_NAME_PERSON_ID"))
24 | private PersonEntity personEntity;
25 |
26 | public Long getId()
27 | {
28 | return this.myId;
29 | }
30 |
31 | public PersonEntity getPersonEntity() {
32 | return this.personEntity;
33 | }
34 | public void setPersonEntity(PersonEntity personEntity) {
35 | this.personEntity = personEntity;
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/Person/PersonTelecom.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.Person;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseContactPoint;
4 |
5 | import javax.persistence.*;
6 |
7 |
8 | @Entity
9 | @Table(name="PersonTelecom",
10 | uniqueConstraints= @UniqueConstraint(name="PK_PERSON_TELECOM2", columnNames={"PERSON_TELECOM_ID"})
11 | ,indexes =
12 | {
13 | @Index(name = "IDX_MPIPERSON_TELECOM", columnList="CONTACT_VALUE,SYSTEM_ID")
14 | })
15 | public class PersonTelecom extends BaseContactPoint {
16 |
17 | public PersonTelecom() {
18 |
19 | }
20 |
21 | public PersonTelecom(PersonEntity personEntity) {
22 | this.personEntity = personEntity;
23 | }
24 |
25 | @Id
26 | @GeneratedValue(strategy = GenerationType.IDENTITY)
27 | @Column(name= "PERSON_TELECOM_ID")
28 | private Long identifierId;
29 |
30 | @ManyToOne(fetch = FetchType.LAZY)
31 | @JoinColumn (name = "PERSON_ID",foreignKey= @ForeignKey(name="FK_PERSON_PERSON_TELECOM"))
32 | private PersonEntity personEntity;
33 |
34 |
35 | public Long getTelecomId() { return identifierId; }
36 | public void setTelecomId(Long identifierId) { this.identifierId = identifierId; }
37 |
38 | public PersonEntity getPerson() {
39 | return this.personEntity;
40 | }
41 |
42 | public void setPersonEntity(PersonEntity personEntity) {
43 | this.personEntity = personEntity;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/appointment/AppointmentIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.appointment;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 | import uk.nhs.careconnect.ri.database.entity.schedule.ScheduleEntity;
5 |
6 | import javax.persistence.*;
7 |
8 |
9 | @Entity
10 | @Table(name="AppointmentIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_APPOINTMENT_IDENTIFIER", columnNames={"APPOINTMENT_IDENTIFIER_ID"})
11 | )
12 | public class AppointmentIdentifier extends BaseIdentifier {
13 |
14 | public AppointmentIdentifier() {
15 |
16 | }
17 |
18 | public AppointmentIdentifier(AppointmentEntity appointment) {
19 | this.appointment = appointment;
20 | }
21 |
22 | @Id
23 | @GeneratedValue(strategy = GenerationType.IDENTITY)
24 | @Column(name= "APPOINTMENT_IDENTIFIER_ID")
25 | private Long identifierId;
26 |
27 | @ManyToOne(fetch = FetchType.LAZY)
28 | @JoinColumn (name = "APPOINTMENT_ID",foreignKey= @ForeignKey(name="FK_APPOINTMENT_APPOINTMENT_IDENTIFIER"))
29 | private AppointmentEntity appointment;
30 |
31 | public Long getIdentifierId() {
32 | return identifierId;
33 | }
34 |
35 | public void setIdentifierId(Long identifierId) {
36 | this.identifierId = identifierId;
37 | }
38 |
39 | public AppointmentEntity getAppointment() {
40 | return appointment;
41 | }
42 |
43 | public void setAppointment(AppointmentEntity appointment) {
44 | this.appointment = appointment;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/appointment/AppointmentSlot.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.appointment;
2 |
3 |
4 | import uk.nhs.careconnect.ri.database.entity.BaseResource;
5 | import uk.nhs.careconnect.ri.database.entity.slot.SlotEntity;
6 |
7 | import javax.persistence.*;
8 |
9 | @Entity
10 | @Table(name = "AppointmentSlot")
11 | public class AppointmentSlot extends BaseResource {
12 |
13 | @Id
14 | @GeneratedValue(strategy = GenerationType.IDENTITY)
15 | @Column(name="APPOINTMENT_SLOT_ID")
16 | private Long Id;
17 |
18 | @ManyToOne(fetch = FetchType.LAZY)
19 | @JoinColumn(name = "APPOINTMENT_ID",foreignKey= @ForeignKey(name="FK_APPOINTMENT_SLOT_SERVICE_ID"))
20 | private AppointmentEntity service;
21 |
22 | @ManyToOne(fetch = FetchType.LAZY)
23 | @JoinColumn(name="SLOT_ID",foreignKey= @ForeignKey(name="FK_APPOINTMENT_SLOT_SLOT_ID"))
24 | private SlotEntity slot;
25 |
26 | @Override
27 | public Long getId() { return Id; }
28 |
29 | public void setId(Long id) { Id = id; }
30 |
31 | public AppointmentEntity getService() { return service; }
32 |
33 | public void setService(AppointmentEntity service) { this.service = service; }
34 |
35 | public SlotEntity getSlot() { return slot; }
36 |
37 | public void setSlot(SlotEntity slot) { this.slot = slot; }
38 | }
39 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/carePlan/CarePlanIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.carePlan;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="CarePlanIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_CAREPLAN_IDENTIFIER", columnNames={"CAREPLAN_IDENTIFIER_ID"})
9 | ,indexes = {}
10 | )
11 | public class CarePlanIdentifier extends BaseIdentifier {
12 |
13 | public CarePlanIdentifier() {
14 | }
15 | public CarePlanIdentifier(CarePlanEntity carePlan) {
16 | this.carePlan = carePlan;
17 | }
18 |
19 |
20 | @Id
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
22 | @Column(name= "CAREPLAN_IDENTIFIER_ID")
23 | private Long identifierId;
24 |
25 | @ManyToOne(fetch = FetchType.LAZY)
26 | @JoinColumn (name = "CAREPLAN_ID",foreignKey= @ForeignKey(name="FK_CAREPLAN_IDENTIFIER_CAREPLAN_ID"))
27 |
28 | private CarePlanEntity carePlan;
29 |
30 |
31 | public Long getIdentifierId() { return identifierId; }
32 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
33 |
34 | public CarePlanEntity getCarePlan() {
35 | return carePlan;
36 | }
37 |
38 | public void setCarePlan(CarePlanEntity carePlan) {
39 | this.carePlan = carePlan;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/carePlan/CarePlanSupportingInformation.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.carePlan;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseReferenceItem;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="CarePlanSupportingInformation", uniqueConstraints= @UniqueConstraint(name="PK_CARE_SUPP_INFO", columnNames={"CARE_SUPP_INFO_ID"})
9 | ,indexes = {}
10 | )
11 | public class CarePlanSupportingInformation extends BaseReferenceItem {
12 |
13 | public CarePlanSupportingInformation() {
14 | }
15 |
16 | private static final int MAX_DESC_LENGTH = 512;
17 |
18 | @Id
19 | @GeneratedValue(strategy = GenerationType.IDENTITY)
20 | @Column(name= "CARE_SUPP_INFO_ID")
21 | private Long infoId;
22 |
23 | @ManyToOne(fetch = FetchType.LAZY)
24 | @JoinColumn (name = "CARE_PLAN_ID",foreignKey= @ForeignKey(name="FK_CARE_SUPP_INFO_CARE_PLAN_ID"))
25 | private CarePlanEntity carePlan;
26 |
27 | @Override
28 | public Long getId() {
29 | return null;
30 | }
31 |
32 | public static int getMaxDescLength() {
33 | return MAX_DESC_LENGTH;
34 | }
35 |
36 | public Long getInfoId() {
37 | return infoId;
38 | }
39 |
40 | public void setInfoId(Long infoId) {
41 | this.infoId = infoId;
42 | }
43 |
44 | public CarePlanEntity getCarePlan() {
45 | return carePlan;
46 | }
47 |
48 | public void setCarePlan(CarePlanEntity carePlan) {
49 | this.carePlan = carePlan;
50 | }
51 |
52 |
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/careTeam/CareTeamIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.careTeam;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 | import javax.persistence.*;
5 |
6 | @Entity
7 | @Table(name="CareTeamIdentifier2", uniqueConstraints= @UniqueConstraint(name="PK_CARE_TEAM_IDENTIFIER", columnNames={"CARE_TEAM_IDENTIFIER_ID"})
8 | ,indexes = {}
9 | )
10 | public class CareTeamIdentifier extends BaseIdentifier {
11 |
12 | public CareTeamIdentifier() {
13 | }
14 | public CareTeamIdentifier(CareTeamEntity team) {
15 | this.team = team;
16 | }
17 |
18 |
19 | @Id
20 | @GeneratedValue(strategy = GenerationType.IDENTITY)
21 | @Column(name= "CARE_TEAM_IDENTIFIER_ID")
22 | private Long identifierId;
23 |
24 | @ManyToOne(fetch = FetchType.LAZY)
25 | @JoinColumn (name = "CARE_TEAM_ID",foreignKey= @ForeignKey(name="FK_CARE_TEAM_IDENTIFIER_CARE_TEAM_ID"))
26 |
27 | private CareTeamEntity team;
28 |
29 |
30 | public Long getIdentifierId() { return identifierId; }
31 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
32 |
33 | public CareTeamEntity getCareTeam() {
34 | return team;
35 | }
36 |
37 | public void setCareTeam(CareTeamEntity team) {
38 | this.team = team;
39 | }
40 |
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/claim/ClaimIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.claim;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 | import uk.nhs.careconnect.ri.database.entity.claim.ClaimEntity;
5 |
6 | import javax.persistence.*;
7 |
8 | @Entity
9 | @Table(name="ClaimIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_CLAIM_IDENTIFIER", columnNames={"CLAIM_IDENTIFIER_ID"})
10 | ,indexes = {}
11 | )
12 | public class ClaimIdentifier extends BaseIdentifier {
13 |
14 | public ClaimIdentifier() {
15 | }
16 | public ClaimIdentifier(ClaimEntity claim) {
17 | this.claim = claim;
18 | }
19 |
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | @Column(name= "CLAIM_IDENTIFIER_ID")
24 | private Long identifierId;
25 |
26 | @ManyToOne(fetch = FetchType.LAZY)
27 | @JoinColumn (name = "CLAIM_ID",foreignKey= @ForeignKey(name="FK_CLAIM_IDENTIFIER_CLAIM_ID"))
28 |
29 | private ClaimEntity claim;
30 |
31 |
32 | public Long getIdentifierId() { return identifierId; }
33 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
34 |
35 | public ClaimEntity getClaim() {
36 | return claim;
37 | }
38 |
39 | public void setClaim(ClaimEntity claim) {
40 | this.claim = claim;
41 | }
42 |
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/claim/ClaimPriority.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.claim;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseCodeableConcept;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="ClaimPriority")
9 | public class ClaimPriority extends BaseCodeableConcept {
10 |
11 | @Id
12 | @Column(name= "CLAIM_PRIORITY_ID")
13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
14 | private Long Id;
15 |
16 | @OneToOne(mappedBy = "priority")
17 | private ClaimEntity claim;
18 |
19 | public void setId(Long id) {
20 | Id = id;
21 | }
22 |
23 | public Long getId() {
24 | return Id;
25 | }
26 |
27 | public ClaimEntity getClaim() {
28 | return claim;
29 | }
30 |
31 | public void setClaim(ClaimEntity claim) {
32 | this.claim = claim;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/claim/ClaimSubType.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.claim;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseCodeableConcept;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="ClaimSubType")
9 | public class ClaimSubType extends BaseCodeableConcept {
10 |
11 | @Id
12 | @Column(name= "CLAIM_SUB_TYPE_ID")
13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
14 | private Long Id;
15 |
16 | @OneToOne(mappedBy = "subType")
17 | private ClaimEntity claim;
18 |
19 | public void setId(Long id) {
20 | Id = id;
21 | }
22 |
23 | public Long getId() {
24 | return Id;
25 | }
26 |
27 | public ClaimEntity getClaim() {
28 | return claim;
29 | }
30 |
31 | public void setClaim(ClaimEntity claim) {
32 | this.claim = claim;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/claim/ClaimSupportingInformation.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.claim;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseReferenceItem;
4 |
5 |
6 | import javax.persistence.*;
7 |
8 | @Entity
9 | @Table(name="ClaimSupportingInformation", uniqueConstraints= @UniqueConstraint(name="PK_CLAIM_SUPP_INFO", columnNames={"CLAIM_SUPP_INFO_ID"})
10 | ,indexes = {}
11 | )
12 | public class ClaimSupportingInformation extends BaseReferenceItem {
13 |
14 | public ClaimSupportingInformation() {
15 | }
16 |
17 | private static final int MAX_DESC_LENGTH = 512;
18 |
19 | @Id
20 | @GeneratedValue(strategy = GenerationType.IDENTITY)
21 | @Column(name= "CLAIM_SUPP_INFO_ID")
22 | private Long infoId;
23 |
24 | @ManyToOne(fetch = FetchType.LAZY)
25 | @JoinColumn (name = "CLAIM_ID",foreignKey= @ForeignKey(name="FK_CLAIM_SUPP_INFO_CLAIM_ID"))
26 | private ClaimEntity claim;
27 |
28 | @Override
29 | public Long getId() {
30 | return null;
31 | }
32 |
33 | public static int getMaxDescLength() {
34 | return MAX_DESC_LENGTH;
35 | }
36 |
37 | public Long getInfoId() {
38 | return infoId;
39 | }
40 |
41 | public void setInfoId(Long infoId) {
42 | this.infoId = infoId;
43 | }
44 |
45 | public ClaimEntity getClaim() {
46 | return claim;
47 | }
48 |
49 | public void setClaim(ClaimEntity claim) {
50 | this.claim = claim;
51 | }
52 |
53 |
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/claim/ClaimType.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.claim;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseCodeableConcept;
4 | import javax.persistence.*;
5 |
6 | @Entity
7 | @Table(name="ClaimType")
8 | public class ClaimType extends BaseCodeableConcept {
9 |
10 | @Id
11 | @GeneratedValue(strategy = GenerationType.IDENTITY)
12 | @Column(name= "CLAIM_TYPE_ID")
13 | private Long Id;
14 |
15 | @OneToOne(mappedBy = "type")
16 | private ClaimEntity claim;
17 |
18 | public void setId(Long id) {
19 | Id = id;
20 | }
21 |
22 | public Long getId() {
23 | return Id;
24 | }
25 |
26 | public ClaimEntity getClaim() {
27 | return claim;
28 | }
29 |
30 | public void setClaim(ClaimEntity claim) {
31 | this.claim = claim;
32 | }
33 |
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/codeSystem/CodeSystemTelecom.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.codeSystem;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseContactPoint;
4 | import javax.persistence.*;
5 |
6 |
7 | @Entity
8 | @Table(name="CodeSystemTelecom", uniqueConstraints= @UniqueConstraint(name="PK_CODESYSTEM_TELECOM", columnNames={"CODESYSTEM_TELECOM_ID"})
9 | ,indexes =
10 | {
11 | @Index(name = "IDX_CODESYSTEM_TELECOM", columnList="CONTACT_VALUE,SYSTEM_ID"),
12 | @Index(name = "IDX_CODESYSTEM_TELECOM_CODESYSTEM_ID", columnList="CODESYSTEM_ID")
13 | })
14 | public class CodeSystemTelecom extends BaseContactPoint {
15 |
16 | public CodeSystemTelecom() {
17 |
18 | }
19 |
20 | @Id
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
22 | @Column(name= "CODESYSTEM_TELECOM_ID")
23 | private Long telecomId;
24 |
25 | @ManyToOne(fetch = FetchType.LAZY)
26 | @JoinColumn (name = "CODESYSTEM_ID",foreignKey= @ForeignKey(name="FK_CODESYSTEM_TELECOM_CODESYSTEM_ID"))
27 | private CodeSystemEntity codeSystemEntity;
28 |
29 | public Long getTelecomId() {
30 | return telecomId;
31 | }
32 |
33 | public void setTelecomId(Long telecomId) {
34 | this.telecomId = telecomId;
35 | }
36 |
37 | public CodeSystemEntity getCodeSystem() {
38 | return codeSystemEntity;
39 | }
40 |
41 | public void setCodeSystem(CodeSystemEntity codeSystemEntity) {
42 | this.codeSystemEntity = codeSystemEntity;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/codeSystem/SystemEntity.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.codeSystem;
2 |
3 | import org.hibernate.annotations.CacheConcurrencyStrategy;
4 | import uk.nhs.careconnect.ri.database.entity.BaseResource;
5 |
6 | import javax.persistence.*;
7 |
8 | @Table(name="System", uniqueConstraints= {
9 | @UniqueConstraint(name="IDX_CS_SYSTEM", columnNames= {"SYSTEM_URI"})
10 | })
11 | @Entity()
12 | @Cacheable
13 | @org.hibernate.annotations.Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
14 | public class SystemEntity extends BaseResource {
15 |
16 | @Id()
17 | @GeneratedValue(strategy = GenerationType.IDENTITY)
18 | @Column(name = "SYSTEM_ID")
19 | private Long myPid;
20 |
21 | public Long getId()
22 | {
23 | return this.myPid;
24 | }
25 |
26 |
27 | @Column(name="SYSTEM_URI", nullable=false)
28 | private String codeSystemUri;
29 |
30 | public String getUri() {
31 | return codeSystemUri;
32 | }
33 | public void setUri(String theCodeSystemUri) {
34 | codeSystemUri = theCodeSystemUri;
35 | }
36 |
37 |
38 | @Column(name="SYSTEM_NAME", nullable=true)
39 | private String name;
40 |
41 | public String getName() {
42 | return name;
43 | }
44 | public void setName(String theName) {
45 | name = theName;
46 | }
47 |
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/conceptMap/ConceptMapTelecom.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.conceptMap;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseContactPoint;
4 |
5 | import javax.persistence.*;
6 |
7 |
8 | @Entity
9 | @Table(name="ConceptMapTelecom", uniqueConstraints= @UniqueConstraint(name="PK_CONCEPT_MAP_TELECOM", columnNames={"CONCEPT_MAP_TELECOM_ID"})
10 | ,indexes =
11 | {
12 | @Index(name = "IDX_CONCEPT_MAP_TELECOM", columnList="CONTACT_VALUE,SYSTEM_ID"),
13 | @Index(name = "IDX_CONCEPT_MAP_TELECOM_CONCEPT_MAP_ID", columnList="CONCEPT_MAP_ID")
14 | })
15 | public class ConceptMapTelecom extends BaseContactPoint {
16 |
17 | public ConceptMapTelecom() {
18 |
19 | }
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | @Column(name= "CONCEPT_MAP_TELECOM_ID")
24 | private Long telecomId;
25 |
26 | @ManyToOne(fetch = FetchType.LAZY)
27 | @JoinColumn (name = "CONCEPT_MAP_ID",foreignKey= @ForeignKey(name="FK_CONCEPT_MAP_TELECOM_CONCEPT_MAP_ID"))
28 | private ConceptMapEntity conceptMap;
29 |
30 | public Long getTelecomId() {
31 | return telecomId;
32 | }
33 |
34 | public void setTelecomId(Long telecomId) {
35 | this.telecomId = telecomId;
36 | }
37 |
38 | public ConceptMapEntity getConceptMap() {
39 | return conceptMap;
40 | }
41 |
42 | public void setConceptMap(ConceptMapEntity conceptMap) {
43 | this.conceptMap = conceptMap;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/consent/ConsentIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.consent;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="ConsentIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_CONSENT_IDENTIFIER", columnNames={"CONSENT_IDENTIFIER_ID"})
9 | ,indexes = {}
10 | )
11 | public class ConsentIdentifier extends BaseIdentifier {
12 |
13 | public ConsentIdentifier() {
14 | }
15 | public ConsentIdentifier(ConsentEntity consent) {
16 | this.consent = consent;
17 | }
18 |
19 |
20 | @Id
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
22 | @Column(name= "CONSENT_IDENTIFIER_ID")
23 | private Long identifierId;
24 |
25 | @ManyToOne(fetch = FetchType.LAZY)
26 | @JoinColumn (name = "CONSENT_ID",foreignKey= @ForeignKey(name="FK_CONSENT_IDENTIFIER_CONSENT_ID"))
27 |
28 | private ConsentEntity consent;
29 |
30 |
31 | public Long getIdentifierId() { return identifierId; }
32 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
33 |
34 | public ConsentEntity getConsent() {
35 | return consent;
36 | }
37 |
38 | public void setConsent(ConsentEntity consent) {
39 | this.consent = consent;
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/consent/ConsentParty.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.consent;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseReferenceItem;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="ConsentParty", uniqueConstraints= @UniqueConstraint(name="PK_CONSENT_PARTY", columnNames={"CONSENT_PARTY_ID"})
9 | ,indexes = {}
10 | )
11 | public class ConsentParty extends BaseReferenceItem {
12 |
13 | public ConsentParty() {
14 | }
15 |
16 | private static final int MAX_DESC_LENGTH = 512;
17 |
18 | @Id
19 | @GeneratedValue(strategy = GenerationType.IDENTITY)
20 | @Column(name= "CONSENT_PARTY_ID")
21 | private Long infoId;
22 |
23 | @ManyToOne(fetch = FetchType.LAZY)
24 | @JoinColumn (name = "CONSENT_ID",foreignKey= @ForeignKey(name="FK_CONSENT_PARTY_CONSENT_ID"))
25 | private ConsentEntity consent;
26 |
27 | @Override
28 | public Long getId() {
29 | return null;
30 | }
31 |
32 | public static int getMaxDescLength() {
33 | return MAX_DESC_LENGTH;
34 | }
35 |
36 |
37 | public Long getInfoId() {
38 | return infoId;
39 | }
40 |
41 | public void setInfoId(Long infoId) {
42 | this.infoId = infoId;
43 | }
44 |
45 | public ConsentEntity getConsent() {
46 | return consent;
47 | }
48 |
49 | public void setConsent(ConsentEntity consent) {
50 | this.consent = consent;
51 | }
52 |
53 |
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/consent/ConsentPurpose.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.consent;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.codeSystem.ConceptEntity;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="ConsentPurpose1")
9 | public class ConsentPurpose {
10 |
11 | @Id
12 | @GeneratedValue(strategy = GenerationType.IDENTITY)
13 | @Column(name= "CONSENT_PURPOSE_ID")
14 | private Long Id;
15 |
16 | @ManyToOne(fetch = FetchType.LAZY)
17 | @JoinColumn (name = "CONSENT_ID",foreignKey= @ForeignKey(name="FK_CONSENT_PURPOSE_CONSENT_ID"))
18 | private ConsentEntity consent;
19 |
20 | @ManyToOne(fetch = FetchType.LAZY)
21 | @JoinColumn(name="PURPOSE_CONCEPT_ID",foreignKey= @ForeignKey(name="FK_CONSENT_PURPOSE_PURPOSE_CONCEPT_ID"))
22 | private ConceptEntity purposeCode;
23 |
24 | public void setId(Long id) {
25 | Id = id;
26 | }
27 |
28 | public Long getId() {
29 | return Id;
30 | }
31 |
32 | public ConceptEntity getPurposeCode() {
33 | return purposeCode;
34 | }
35 |
36 | public void setPurposeCode(ConceptEntity purposeCode) {
37 | this.purposeCode = purposeCode;
38 | }
39 |
40 | public ConsentEntity getConsent() {
41 | return consent;
42 | }
43 |
44 |
45 | public void setConsent(ConsentEntity consent) {
46 | this.consent = consent;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/encounter/EncounterExtension.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.encounter;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseExtension;
4 | import uk.nhs.careconnect.ri.database.entity.patient.PatientEntity;
5 |
6 | import javax.persistence.*;
7 |
8 | @Entity
9 | @Table(name = "EncounterExtension")
10 | public class EncounterExtension extends BaseExtension {
11 |
12 | @Id
13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
14 | @Column(name="ENCOUNTER_EXTENSION_ID")
15 | private Long extensionId;
16 |
17 | @ManyToOne(fetch = FetchType.LAZY)
18 | @JoinColumn(name = "ENCOUNTER_ID",foreignKey= @ForeignKey(name="FK_ENCOUNTER_EXTENSION_ENCOUNTER"))
19 | private EncounterEntity encounter;
20 |
21 | public Long getExtensionId() {
22 | return extensionId;
23 | }
24 |
25 | public void setExtensionId(Long extensionId) {
26 | this.extensionId = extensionId;
27 | }
28 |
29 | public EncounterEntity getEncounter() {
30 | return encounter;
31 | }
32 |
33 | public void setEncounter(EncounterEntity encounter) {
34 | this.encounter = encounter;
35 | }
36 |
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/endpoint/EndpointPayloadMime.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.endpoint;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseResource;
4 | import uk.nhs.careconnect.ri.database.entity.codeSystem.ConceptEntity;
5 |
6 |
7 | import javax.persistence.*;
8 |
9 | @Entity
10 | @Table(name = "EndpointPayloadMime")
11 | public class EndpointPayloadMime extends BaseResource {
12 |
13 | @Id
14 | @GeneratedValue(strategy = GenerationType.IDENTITY)
15 | @Column(name="ENDPOINT_PAYLOAD_MIME_ID")
16 | private Long myId;
17 |
18 | @ManyToOne(fetch = FetchType.LAZY)
19 | @JoinColumn(name = "ENDPOINT_ID",foreignKey= @ForeignKey(name="FK_ENDPOINT_PAYLOAD_MIME_ENDPOINT_ROLE_ID"))
20 | private EndpointEntity endpoint;
21 |
22 | @ManyToOne(fetch = FetchType.LAZY)
23 | @JoinColumn(name="PAYLOAD_MIME_CONCEPT_ID",foreignKey= @ForeignKey(name="FK_ENDPOINT_PAYLOAD_MIME_PAYLOAD_MIME_CONCEPT_ID"))
24 | private ConceptEntity mimeType;
25 |
26 | public Long getId()
27 | {
28 | return this.myId;
29 | }
30 |
31 | public Long getMyId() {
32 | return myId;
33 | }
34 |
35 | public void setMyId(Long myId) {
36 | this.myId = myId;
37 | }
38 |
39 | public ConceptEntity getMimeType() {
40 | return mimeType;
41 | }
42 |
43 | public void setMimeType(ConceptEntity mimeType) {
44 | this.mimeType = mimeType;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/endpoint/EndpointTelecom.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.endpoint;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseContactPoint;
4 | import uk.nhs.careconnect.ri.database.entity.endpoint.EndpointEntity;
5 |
6 | import javax.persistence.*;
7 |
8 |
9 | @Entity
10 | @Table(name="EndpointTelecom", uniqueConstraints= @UniqueConstraint(name="PK_ENDPOINT_TELECOM", columnNames={"ENDPOINT_TELECOM_ID"})
11 | ,indexes =
12 | {
13 | @Index(name = "IDX_ENDPOINT_TELECOM", columnList="CONTACT_VALUE,SYSTEM_ID"),
14 | @Index(name = "IDX_ENDPOINT_TELECOM_ENDPOINT_ID", columnList="ENDPOINT_ID")
15 | })
16 | public class EndpointTelecom extends BaseContactPoint {
17 |
18 | public EndpointTelecom() {
19 |
20 | }
21 |
22 | @Id
23 | @GeneratedValue(strategy = GenerationType.IDENTITY)
24 | @Column(name= "ENDPOINT_TELECOM_ID")
25 | private Long telecomId;
26 |
27 | @ManyToOne(fetch = FetchType.LAZY)
28 | @JoinColumn (name = "ENDPOINT_ID",foreignKey= @ForeignKey(name="FK_ENDPOINT_TELECOM_ENDPOINT_ID"))
29 | private EndpointEntity endpoint;
30 |
31 | public Long getTelecomId() {
32 | return telecomId;
33 | }
34 |
35 | public void setTelecomId(Long telecomId) {
36 | this.telecomId = telecomId;
37 | }
38 |
39 | public EndpointEntity getEndpoint() {
40 | return endpoint;
41 | }
42 |
43 | public void setEndpoint(EndpointEntity endpoint) {
44 | this.endpoint = endpoint;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/flag/FlagIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.flag;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="FlagIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_FLAG_IDENTIFIER", columnNames={"FLAG_IDENTIFIER_ID"})
9 | ,indexes = {}
10 | )
11 | public class FlagIdentifier extends BaseIdentifier {
12 |
13 | public FlagIdentifier() {
14 | }
15 | public FlagIdentifier(FlagEntity flag) {
16 | this.flag = flag;
17 | }
18 |
19 |
20 | @Id
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
22 | @Column(name= "FLAG_IDENTIFIER_ID")
23 | private Long identifierId;
24 |
25 | @ManyToOne(fetch = FetchType.LAZY)
26 | @JoinColumn (name = "FLAG_ID",foreignKey= @ForeignKey(name="FK_FLAG_IDENTIFIER_FLAG_ID"))
27 |
28 | private FlagEntity flag;
29 |
30 |
31 | public Long getIdentifierId() { return identifierId; }
32 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
33 |
34 | public FlagEntity getFlag() {
35 | return flag;
36 | }
37 |
38 | public void setFlag(FlagEntity flag) {
39 | this.flag = flag;
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/goal/GoalAddresses.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.goal;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseResource;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="GoalAddresses", uniqueConstraints= @UniqueConstraint(name="PK_GOAL_ADDRESSES", columnNames={"GOAL_ADDRESSES_ID"})
9 | ,indexes = {}
10 | )
11 | public class GoalAddresses extends BaseResource {
12 |
13 | public GoalAddresses()
14 | {
15 | }
16 | public GoalAddresses(GoalEntity goal) {
17 | this.goal = goal;
18 | }
19 |
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | @Column(name= "GOAL_ADDRESSES_ID")
24 | private Long addressesId;
25 |
26 | @ManyToOne(fetch = FetchType.LAZY)
27 | @JoinColumn (name = "GOAL_ID")
28 | private GoalEntity goal;
29 |
30 | public Long getAddressesId() { return addressesId; }
31 | public void setAddressesId(Long addressesId) { this.addressesId = addressesId; }
32 |
33 | public GoalEntity getGoal() {
34 | return goal;
35 | }
36 |
37 | public void setGoal(GoalEntity goal) {
38 | this.goal = goal;
39 | }
40 |
41 | @Override
42 | public Long getId() {
43 | return this.addressesId;
44 | }
45 |
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/goal/GoalIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.goal;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 |
6 | import javax.persistence.*;
7 |
8 | @Entity
9 | @Table(name="GoalIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_GOAL_IDENTIFIER", columnNames={"GOAL_IDENTIFIER_ID"})
10 | ,indexes = {}
11 | )
12 | public class GoalIdentifier extends BaseIdentifier {
13 |
14 | public GoalIdentifier() {
15 | }
16 | public GoalIdentifier(GoalEntity goal) {
17 | this.goal = goal;
18 | }
19 |
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | @Column(name= "GOAL_IDENTIFIER_ID")
24 | private Long identifierId;
25 |
26 | @ManyToOne(fetch = FetchType.LAZY)
27 | @JoinColumn (name = "GOAL_ID",foreignKey= @ForeignKey(name="FK_GOAL_IDENTIFIER_GOAL_ID"))
28 |
29 | private GoalEntity goal;
30 |
31 |
32 | public Long getIdentifierId() { return identifierId; }
33 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
34 |
35 | public GoalEntity getGoal() {
36 | return goal;
37 | }
38 |
39 | public void setGoal(GoalEntity goal) {
40 | this.goal = goal;
41 | }
42 |
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/graphDefinition/GraphDefinitionTelecom.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.graphDefinition;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseContactPoint;
4 |
5 | import javax.persistence.*;
6 |
7 |
8 | @Entity
9 | @Table(name="GraphDefinitionTelecom", uniqueConstraints= @UniqueConstraint(name="PK_GRAPH_TELECOM", columnNames={"GRAPH_TELECOM_ID"})
10 | ,indexes =
11 | {
12 | @Index(name = "IDX_GRAPH_TELECOM", columnList="CONTACT_VALUE,SYSTEM_ID"),
13 | @Index(name = "IDX_GRAPH_TELECOM_GRAPH_ID", columnList="GRAPH_ID")
14 | })
15 | public class GraphDefinitionTelecom extends BaseContactPoint {
16 |
17 | public GraphDefinitionTelecom() {
18 |
19 | }
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | @Column(name= "GRAPH_TELECOM_ID")
24 | private Long telecomId;
25 |
26 | @ManyToOne(fetch = FetchType.LAZY)
27 | @JoinColumn (name = "GRAPH_ID",foreignKey= @ForeignKey(name="FK_GRAPH_TELECOM_GRAPH_ID"))
28 | private GraphDefinitionEntity graph;
29 |
30 | public Long getTelecomId() {
31 | return telecomId;
32 | }
33 |
34 | public void setTelecomId(Long telecomId) {
35 | this.telecomId = telecomId;
36 | }
37 |
38 | public GraphDefinitionEntity getGraphDefinition() {
39 | return graph;
40 | }
41 |
42 | public void setGraphDefinition(GraphDefinitionEntity graph) {
43 | this.graph = graph;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/healthcareService/HealthcareServiceIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.healthcareService;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 |
8 | @Entity
9 | @Table(name="HealthcareServiceIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_SERVICE_IDENTIFIER", columnNames={"SERVICE_IDENTIFIER_ID"})
10 | )
11 | public class HealthcareServiceIdentifier extends BaseIdentifier {
12 |
13 | public HealthcareServiceIdentifier() {
14 |
15 | }
16 |
17 | public HealthcareServiceIdentifier(HealthcareServiceEntity service) {
18 | this.service = service;
19 | }
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | @Column(name= "SERVICE_IDENTIFIER_ID")
24 | private Long identifierId;
25 |
26 | @ManyToOne(fetch = FetchType.LAZY)
27 | @JoinColumn (name = "SERVICE_ID",foreignKey= @ForeignKey(name="FK_SERVICE_SERVICE_IDENTIFIER"))
28 | private HealthcareServiceEntity service;
29 |
30 |
31 | public Long getIdentifierId() { return identifierId; }
32 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
33 |
34 |
35 | public HealthcareServiceEntity getService() {
36 | return service;
37 | }
38 |
39 | public void setService(HealthcareServiceEntity service) {
40 | this.service = service;
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/healthcareService/HealthcareServiceTelecom.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.healthcareService;
2 | import uk.nhs.careconnect.ri.database.entity.BaseContactPoint;
3 | import javax.persistence.*;
4 |
5 |
6 | @Entity
7 | @Table(name="HealthcareServiceTelecom", uniqueConstraints= @UniqueConstraint(name="PK_SERVICE_TELECOM", columnNames={"SERVICE_TELECOM_ID"}))
8 | public class HealthcareServiceTelecom extends BaseContactPoint {
9 |
10 | public HealthcareServiceTelecom() {
11 |
12 | }
13 |
14 | public HealthcareServiceTelecom(HealthcareServiceEntity serviceEntity) {
15 | this.service = serviceEntity;
16 | }
17 |
18 | @Id
19 | @GeneratedValue(strategy = GenerationType.IDENTITY)
20 | @Column(name= "SERVICE_TELECOM_ID")
21 | private Long identifierId;
22 |
23 | @ManyToOne(fetch = FetchType.LAZY)
24 | @JoinColumn (name = "SERVICE_ID",foreignKey= @ForeignKey(name="FK_SERVICE_SERVICE_TELECOM"))
25 | private HealthcareServiceEntity service;
26 |
27 |
28 | public Long getTelecomId() { return identifierId; }
29 | public void setTelecomId(Long identifierId) { this.identifierId = identifierId; }
30 |
31 | public HealthcareServiceEntity getHealthcareService() {
32 | return this.service;
33 | }
34 | public void setHealthcareService(HealthcareServiceEntity serviceEntity) {
35 | this.service = serviceEntity;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/list/ListIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.list;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="ListIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_LIST_IDENTIFIER", columnNames={"LIST_IDENTIFIER_ID"})
9 | ,indexes = {}
10 | )
11 | public class ListIdentifier extends BaseIdentifier {
12 |
13 | public ListIdentifier() {
14 | }
15 | public ListIdentifier(ListEntity list) {
16 | this.list = list;
17 | }
18 |
19 |
20 | @Id
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
22 | @Column(name= "LIST_IDENTIFIER_ID")
23 | private Long identifierId;
24 |
25 | @ManyToOne(fetch = FetchType.LAZY)
26 | @JoinColumn (name = "LIST_ID",foreignKey= @ForeignKey(name="FK_LIST_IDENTIFIER_LIST_ID"))
27 |
28 | private ListEntity list;
29 |
30 |
31 | public Long getIdentifierId() { return identifierId; }
32 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
33 |
34 | public ListEntity getList() {
35 | return list;
36 | }
37 |
38 | public void setList(ListEntity list) {
39 | this.list = list;
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/location/LocationTelecom.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.location;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseContactPoint;
4 |
5 | import javax.persistence.*;
6 |
7 |
8 | @Entity
9 | @Table(name="LocationTelecom",
10 | uniqueConstraints= @UniqueConstraint(name="PK_LOCATION_TELECOM", columnNames={"LOCATION_TELECOM_ID"})
11 | ,indexes =
12 | {
13 | @Index(name = "IDX_LOCATION_TELECOM_LOCATION_ID", columnList="LOCATION_ID")
14 | })
15 | public class LocationTelecom extends BaseContactPoint {
16 |
17 | public LocationTelecom() {
18 |
19 | }
20 |
21 | public LocationTelecom(LocationEntity locationEntity) {
22 | this.locationEntity = locationEntity;
23 | }
24 |
25 | @Id
26 | @GeneratedValue(strategy = GenerationType.IDENTITY)
27 | @Column(name= "LOCATION_TELECOM_ID")
28 | private Long identifierId;
29 |
30 | @ManyToOne(fetch = FetchType.LAZY)
31 | @JoinColumn (name = "LOCATION_ID",foreignKey= @ForeignKey(name="FK_LOCATION_LOCATION_TELECOM"))
32 | private LocationEntity locationEntity;
33 |
34 |
35 | public Long getTelecomId() { return identifierId; }
36 | public void setTelecomId(Long identifierId) { this.identifierId = identifierId; }
37 |
38 | public LocationEntity getLocation() {
39 | return this.locationEntity;
40 | }
41 | public void setLocation(LocationEntity locationEntity) {
42 | this.locationEntity = locationEntity;
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/observation/ObservationIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.observation;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="ObservationIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_OBSERVATION_IDENTIFIER", columnNames={"OBSERVATION_IDENTIFIER_ID"})
9 | ,indexes = {}
10 | )
11 | public class ObservationIdentifier extends BaseIdentifier {
12 |
13 | public ObservationIdentifier() {
14 | }
15 | public ObservationIdentifier(ObservationEntity observation) {
16 | this.observation = observation;
17 | }
18 |
19 |
20 | @Id
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
22 | @Column(name= "OBSERVATION_IDENTIFIER_ID")
23 | private Long identifierId;
24 |
25 | @ManyToOne(fetch = FetchType.LAZY)
26 | @JoinColumn (name = "OBSERVATION_ID",foreignKey= @ForeignKey(name="FK_OBSERVATION_IDENTIFIER_OBSERVATION_ID"))
27 |
28 | private ObservationEntity observation;
29 |
30 |
31 | public Long getIdentifierId() { return identifierId; }
32 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
33 |
34 | public ObservationEntity getObservation() {
35 | return observation;
36 | }
37 |
38 | public void setObservation(ObservationEntity observation) {
39 | this.observation = observation;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/observationDefinition/ObservationDefinitionIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.observationDefinition;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 | import javax.persistence.*;
5 |
6 | @Entity
7 | @Table(name="ObservationDefinitionIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_OBSERVATION_DEF_IDENTIFIER", columnNames={"OBSERVATION_DEF_IDENTIFIER_ID"})
8 | ,indexes = {}
9 | )
10 | public class ObservationDefinitionIdentifier extends BaseIdentifier {
11 |
12 | public ObservationDefinitionIdentifier() {
13 | }
14 |
15 |
16 | @Id
17 | @GeneratedValue(strategy = GenerationType.IDENTITY)
18 | @Column(name= "OBSERVATION_DEF_IDENTIFIER_ID")
19 | private Long identifierId;
20 |
21 | @ManyToOne(fetch = FetchType.LAZY)
22 | @JoinColumn (name = "OBSERVATION_DEF_ID",foreignKey= @ForeignKey(name="FK_OBSERVATION_DEF_IDENTIFIER_OBS_DEF_ID"))
23 |
24 | private ObservationDefinitionEntity observationDefinition;
25 |
26 |
27 | public Long getIdentifierId() { return identifierId; }
28 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
29 |
30 | public ObservationDefinitionEntity getObservationDefinition() {
31 | return observationDefinition;
32 | }
33 |
34 | public void setObservationDefinition(ObservationDefinitionEntity observationDefinition) {
35 | this.observationDefinition = observationDefinition;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/patient/PatientExtension.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.patient;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseExtension;
4 | import javax.persistence.*;
5 |
6 | @Entity
7 | @Table(name = "PatientExtension")
8 | public class PatientExtension extends BaseExtension {
9 |
10 | @Id
11 | @GeneratedValue(strategy = GenerationType.IDENTITY)
12 | @Column(name="PATIENT_EXTENSION_ID")
13 | private Long extensionId;
14 |
15 | @ManyToOne(fetch = FetchType.LAZY)
16 | @JoinColumn(name = "PATIENT_ID",foreignKey= @ForeignKey(name="FK_PATIENT_EXTENSION_PATIENT"))
17 | private PatientEntity patientEntity;
18 |
19 |
20 | public PatientEntity getPatientEntity() {
21 | return this.patientEntity;
22 | }
23 | public void setPatientEntity(PatientEntity patientEntity) {
24 | this.patientEntity = patientEntity;
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/patient/PatientIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.patient;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="PatientIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_PATIENT_IDENTIFIER", columnNames={"PATIENT_IDENTIFIER_ID"})
9 | ,indexes =
10 | {
11 | @Index(name = "IDX_PATIENT_IDENTIFER", columnList="IDENTIFIER_VALUE,SYSTEM_ID")
12 | })
13 | public class PatientIdentifier extends BaseIdentifier {
14 |
15 | public PatientIdentifier() {
16 | }
17 | public PatientIdentifier(PatientEntity patientEntity) {
18 | this.patientEntity = patientEntity;
19 | }
20 |
21 |
22 | @Id
23 | @GeneratedValue(strategy = GenerationType.IDENTITY)
24 | @Column(name= "PATIENT_IDENTIFIER_ID")
25 | private Long identifierId;
26 |
27 | @ManyToOne(fetch = FetchType.LAZY)
28 | @JoinColumn (name = "PATIENT_ID",foreignKey= @ForeignKey(name="FK_PATIENT_PATIENT_IDENTIFIER"))
29 | private PatientEntity patientEntity;
30 |
31 |
32 | public Long getIdentifierId() { return identifierId; }
33 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
34 |
35 | public PatientEntity getPatient() {
36 | return this.patientEntity;
37 | }
38 | public void setPatient(PatientEntity patientEntity) {
39 | this.patientEntity = patientEntity;
40 | }
41 |
42 |
43 |
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/patient/PatientName.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.patient;
2 |
3 |
4 | import uk.nhs.careconnect.ri.database.entity.BaseHumanName;
5 |
6 | import javax.persistence.*;
7 |
8 | @Entity
9 | @Table(name = "PatientName",indexes =
10 | {
11 | @Index(name = "IDX_PATIENT_FAMILY", columnList="family_name")
12 | , @Index(name = "IDX_PATIENT_GIVEN", columnList="given_name")
13 | })
14 | public class PatientName extends BaseHumanName {
15 |
16 | @Id
17 | @GeneratedValue(strategy = GenerationType.IDENTITY)
18 | @Column(name="PATIENT_NAME_ID")
19 | private Long myId;
20 |
21 |
22 | @ManyToOne(fetch = FetchType.LAZY)
23 | @JoinColumn(name = "PATIENT_ID",foreignKey= @ForeignKey(name="FK_PATIENT_NAME_PATIENT_ID"))
24 | private PatientEntity patientEntity;
25 |
26 | public Long getId()
27 | {
28 | return this.myId;
29 | }
30 |
31 | public PatientEntity getPatientEntity() {
32 | return this.patientEntity;
33 | }
34 | public void setPatientEntity(PatientEntity patientEntity) {
35 | this.patientEntity = patientEntity;
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/patient/PatientTelecom.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.patient;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseContactPoint;
4 |
5 | import javax.persistence.*;
6 |
7 |
8 | @Entity
9 | @Table(name="PatientTelecom",
10 | uniqueConstraints= @UniqueConstraint(name="PK_PATIENT_TELECOM", columnNames={"PATIENT_TELECOM_ID"})
11 | ,indexes =
12 | {
13 | @Index(name = "IDX_PATIENT_TELECOM", columnList="CONTACT_VALUE,SYSTEM_ID")
14 | })
15 | public class PatientTelecom extends BaseContactPoint {
16 |
17 | public PatientTelecom() {
18 |
19 | }
20 |
21 | public PatientTelecom(PatientEntity patientEntity) {
22 | this.patientEntity = patientEntity;
23 | }
24 |
25 | @Id
26 | @GeneratedValue(strategy = GenerationType.IDENTITY)
27 | @Column(name= "PATIENT_TELECOM_ID")
28 | private Long identifierId;
29 |
30 | @ManyToOne(fetch = FetchType.LAZY)
31 | @JoinColumn (name = "PATIENT_ID",foreignKey= @ForeignKey(name="FK_PATIENT_PATIENT_TELECOM"))
32 | private PatientEntity patientEntity;
33 |
34 |
35 | public Long getTelecomId() { return identifierId; }
36 | public void setTelecomId(Long identifierId) { this.identifierId = identifierId; }
37 |
38 | public PatientEntity getPatient() {
39 | return this.patientEntity;
40 | }
41 |
42 | public void setPatientEntity(PatientEntity patientEntity) {
43 | this.patientEntity = patientEntity;
44 | }
45 |
46 | }
47 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/practitioner/PractitionerName.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.practitioner;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseHumanName;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name = "PractitionerName",indexes =
9 | {
10 | @Index(name = "IDX_PRACTITIONER_NAME_PRACTITIONER_ID", columnList="PRACTITIONER_ID")
11 | })
12 | public class PractitionerName extends BaseHumanName {
13 | @Id
14 | @GeneratedValue(strategy = GenerationType.IDENTITY)
15 | @Column(name="PRACTITIONER_NAME_ID")
16 | private Long myId;
17 |
18 | @ManyToOne(fetch = FetchType.LAZY)
19 | @JoinColumn(name = "PRACTITIONER_ID",foreignKey= @ForeignKey(name="FK_PRACTITIONER_PRACTITIONER_NAME"))
20 | private PractitionerEntity practitionerEntity;
21 |
22 | public Long getId()
23 | {
24 | return this.myId;
25 | }
26 |
27 | public PractitionerEntity getPractitionerEntity() {
28 | return this.practitionerEntity;
29 | }
30 | public void setPractitionerEntity(PractitionerEntity practitionerEntity) {
31 | this.practitionerEntity = practitionerEntity;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/questionnaire/QuestionnaireIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.questionnaire;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="QuestionnaireIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_QUESTIONNAIRE_IDENTIFIER", columnNames={"QUESTIONNAIRE_IDENTIFIER_ID"})
9 | ,indexes = {}
10 | )
11 | public class QuestionnaireIdentifier extends BaseIdentifier {
12 |
13 | public QuestionnaireIdentifier() {
14 | }
15 | public QuestionnaireIdentifier(QuestionnaireEntity questionnaire) {
16 | this.questionnaire = questionnaire;
17 | }
18 |
19 |
20 | @Id
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
22 | @Column(name= "QUESTIONNAIRE_IDENTIFIER_ID")
23 | private Long identifierId;
24 |
25 | @ManyToOne(fetch = FetchType.LAZY)
26 | @JoinColumn (name = "QUESTIONNAIRE_ID",foreignKey= @ForeignKey(name="FK_QUESTIONNAIRE_IDENTIFIER_QUESTIONNAIRE_ID"))
27 |
28 | private QuestionnaireEntity questionnaire;
29 |
30 |
31 | public Long getIdentifierId() { return identifierId; }
32 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
33 |
34 | public QuestionnaireEntity getQuestionnaire() {
35 | return questionnaire;
36 | }
37 |
38 | public void setQuestionnaire(QuestionnaireEntity questionnaire) {
39 | this.questionnaire = questionnaire;
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/questionnaireResponse/QuestionnaireResponseIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.questionnaireResponse;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 | @Entity
8 | @Table(name="QuestionnaireResponseIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_FORM_IDENTIFIER", columnNames={"FORM_IDENTIFIER_ID"})
9 | ,indexes = {}
10 | )
11 | public class QuestionnaireResponseIdentifier extends BaseIdentifier {
12 |
13 | public QuestionnaireResponseIdentifier() {
14 | }
15 | public QuestionnaireResponseIdentifier(QuestionnaireResponseEntity form) {
16 | this.form = form;
17 | }
18 |
19 |
20 | @Id
21 | @GeneratedValue(strategy = GenerationType.IDENTITY)
22 | @Column(name= "FORM_IDENTIFIER_ID")
23 | private Long identifierId;
24 |
25 | @ManyToOne(fetch = FetchType.LAZY)
26 | @JoinColumn (name = "FORM_ID",foreignKey= @ForeignKey(name="FK_FORM_IDENTIFIER_FORM_ID"))
27 |
28 | private QuestionnaireResponseEntity form;
29 |
30 |
31 | public Long getIdentifierId() { return identifierId; }
32 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
33 |
34 | public QuestionnaireResponseEntity getQuestionnaireResponse() {
35 | return form;
36 | }
37 |
38 | public void setQuestionnaireResponse(QuestionnaireResponseEntity form) {
39 | this.form = form;
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/relatedPerson/RelatedPersonName.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.relatedPerson;
2 |
3 |
4 | import uk.nhs.careconnect.ri.database.entity.BaseHumanName;
5 |
6 | import javax.persistence.*;
7 |
8 | @Entity
9 | @Table(name = "RelatedPersonName",indexes =
10 | {
11 | @Index(name = "IDX_PERSON_FAMILY", columnList="family_name")
12 | , @Index(name = "IDX_PERSON_GIVEN", columnList="given_name")
13 | })
14 | public class RelatedPersonName extends BaseHumanName {
15 |
16 | @Id
17 | @GeneratedValue(strategy = GenerationType.IDENTITY)
18 | @Column(name="PERSON_NAME_ID")
19 | private Long myId;
20 |
21 |
22 | @ManyToOne(fetch = FetchType.LAZY)
23 | @JoinColumn(name = "PERSON_ID",foreignKey= @ForeignKey(name="FK_PERSON_NAME_PERSON_ID"))
24 | private RelatedPersonEntity personEntity;
25 |
26 | public Long getId()
27 | {
28 | return this.myId;
29 | }
30 |
31 | public RelatedPersonEntity getRelatedPersonEntity() {
32 | return this.personEntity;
33 | }
34 | public void setRelatedPersonEntity(RelatedPersonEntity personEntity) {
35 | this.personEntity = personEntity;
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/riskAssessment/RiskAssessmentBasedOn.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.riskAssessment;
2 |
3 |
4 | import uk.nhs.careconnect.ri.database.entity.BaseReferenceItem;
5 |
6 | import javax.persistence.*;
7 |
8 | @Entity
9 | @Table(name="RiskAssessmentBasedOn", uniqueConstraints= @UniqueConstraint(name="PK_RISK_BASEDON", columnNames={"RISK_BASEDON_ID"})
10 | ,indexes = {}
11 | )
12 | public class RiskAssessmentBasedOn extends BaseReferenceItem {
13 |
14 | public RiskAssessmentBasedOn() {
15 | }
16 | public RiskAssessmentBasedOn(RiskAssessmentEntity risk) {
17 | this.risk = risk;
18 | }
19 |
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | @Column(name= "RISK_BASEDON_ID")
24 | private Long identifierId;
25 |
26 | @ManyToOne(fetch = FetchType.LAZY)
27 | @JoinColumn (name = "RISK_ID",foreignKey= @ForeignKey(name="FK_RISK_BASEDON_RISK_ID"))
28 | private RiskAssessmentEntity risk;
29 |
30 |
31 |
32 | public Long getPredictionId() { return identifierId; }
33 | public void setPredictionId(Long identifierId) { this.identifierId = identifierId; }
34 |
35 | public RiskAssessmentEntity getRiskAssessment() {
36 | return risk;
37 | }
38 |
39 | public void setRiskAssessment(RiskAssessmentEntity risk) {
40 | this.risk = risk;
41 | }
42 |
43 |
44 | @Override
45 | public Long getId() {
46 | return null;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/riskAssessment/RiskAssessmentBasis.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.riskAssessment;
2 |
3 |
4 | import uk.nhs.careconnect.ri.database.entity.BaseReferenceItem;
5 |
6 | import javax.persistence.*;
7 |
8 | @Entity
9 | @Table(name="RiskAssessmentBasis", uniqueConstraints= @UniqueConstraint(name="PK_RISK_BASIS", columnNames={"RISK_BASIS_ID"})
10 | ,indexes = {}
11 | )
12 | public class RiskAssessmentBasis extends BaseReferenceItem {
13 |
14 | public RiskAssessmentBasis() {
15 | }
16 | public RiskAssessmentBasis(RiskAssessmentEntity risk) {
17 | this.risk = risk;
18 | }
19 |
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | @Column(name= "RISK_BASIS_ID")
24 | private Long identifierId;
25 |
26 | @ManyToOne(fetch = FetchType.LAZY)
27 | @JoinColumn (name = "RISK_ID",foreignKey= @ForeignKey(name="FK_RISK_BASIS_RISK_ID"))
28 | private RiskAssessmentEntity risk;
29 |
30 |
31 |
32 | public Long getPredictionId() { return identifierId; }
33 | public void setPredictionId(Long identifierId) { this.identifierId = identifierId; }
34 |
35 | public RiskAssessmentEntity getRiskAssessment() {
36 | return risk;
37 | }
38 |
39 | public void setRiskAssessment(RiskAssessmentEntity risk) {
40 | this.risk = risk;
41 | }
42 |
43 |
44 | @Override
45 | public Long getId() {
46 | return null;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/riskAssessment/RiskAssessmentIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.riskAssessment;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 | import javax.persistence.*;
5 |
6 | @Entity
7 | @Table(name="RiskAssessmentIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_RISK_IDENTIFIER", columnNames={"RISK_IDENTIFIER_ID"})
8 | ,indexes = {}
9 | )
10 | public class RiskAssessmentIdentifier extends BaseIdentifier {
11 |
12 | public RiskAssessmentIdentifier() {
13 | }
14 | public RiskAssessmentIdentifier(RiskAssessmentEntity risk) {
15 | this.risk = risk;
16 | }
17 |
18 |
19 | @Id
20 | @GeneratedValue(strategy = GenerationType.IDENTITY)
21 | @Column(name= "RISK_IDENTIFIER_ID")
22 | private Long identifierId;
23 |
24 | @ManyToOne(fetch = FetchType.LAZY)
25 | @JoinColumn (name = "RISK_ID",foreignKey= @ForeignKey(name="FK_RISK_IDENTIFIER_RISK_ID"))
26 |
27 | private RiskAssessmentEntity risk;
28 |
29 |
30 | public Long getIdentifierId() { return identifierId; }
31 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
32 |
33 | public RiskAssessmentEntity getRiskAssessment() {
34 | return risk;
35 | }
36 |
37 | public void setRiskAssessment(RiskAssessmentEntity risk) {
38 | this.risk = risk;
39 | }
40 |
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/schedule/ScheduleIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.schedule;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 |
8 | @Entity
9 | @Table(name="ScheduleIdentifier2", uniqueConstraints= @UniqueConstraint(name="PK_SCHEDULE_IDENTIFIER", columnNames={"SCHEDULE_IDENTIFIER_ID"})
10 | )
11 | public class ScheduleIdentifier extends BaseIdentifier {
12 |
13 | public ScheduleIdentifier() {
14 |
15 | }
16 |
17 | public ScheduleIdentifier(ScheduleEntity schedule) {
18 | this.schedule = schedule;
19 | }
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | @Column(name= "SCHEDULE_IDENTIFIER_ID")
24 | private Long identifierId;
25 |
26 | @ManyToOne(fetch = FetchType.LAZY)
27 | @JoinColumn (name = "SCHEDULE_ID",foreignKey= @ForeignKey(name="FK_SCHEDULE_SCHEDULE_IDENTIFIER"))
28 | private ScheduleEntity schedule;
29 |
30 | public Long getIdentifierId() { return identifierId; }
31 |
32 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
33 |
34 | public ScheduleEntity getSchedule() { return schedule; }
35 |
36 | public void setSchedule(ScheduleEntity schedule) { this.schedule = schedule; }
37 | }
38 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/search/SearchResults.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.search;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseResource;
4 |
5 | import javax.persistence.*;
6 |
7 | @Table(name = "SearchResults"
8 | )
9 | @Entity
10 | public class SearchResults extends BaseResource {
11 |
12 | @Id
13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
14 | @Column(name="SEARCH_ID")
15 | private Long searchId;
16 | public Long getId() {
17 | return this.searchId;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/slot/SlotIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.slot;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 | import uk.nhs.careconnect.ri.database.entity.condition.ConditionEntity;
5 |
6 | import javax.persistence.*;
7 |
8 |
9 | @Entity
10 | @Table(name="SlotIdentifier2", uniqueConstraints= @UniqueConstraint(name="PK_SLOT_IDENTIFIER", columnNames={"SLOT_IDENTIFIER_ID"})
11 | )
12 | public class SlotIdentifier extends BaseIdentifier {
13 |
14 | public SlotIdentifier() {
15 |
16 | }
17 |
18 | public SlotIdentifier(SlotEntity slot) {
19 | this.slot = slot;
20 | }
21 |
22 | @Id
23 | @GeneratedValue(strategy = GenerationType.IDENTITY)
24 | @Column(name= "SLOT_IDENTIFIER_ID")
25 | private Long identifierId;
26 |
27 | @ManyToOne(fetch = FetchType.LAZY)
28 | @JoinColumn (name = "SLOT_ID",foreignKey= @ForeignKey(name="FK_SLOT_SLOT_IDENTIFIER"))
29 | private SlotEntity slot;
30 |
31 | public Long getIdentifierId() { return identifierId; }
32 |
33 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
34 |
35 | public SlotEntity getSlot() { return slot; }
36 |
37 | public void setSlot(SlotEntity slot) { this.slot = slot; }
38 | }
39 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/task/TaskCode.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.task;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseCodeableConcept;
4 | import javax.persistence.*;
5 |
6 | @Entity
7 | @Table(name="TaskCode")
8 | public class TaskCode extends BaseCodeableConcept {
9 |
10 | @Id
11 | @GeneratedValue(strategy = GenerationType.IDENTITY)
12 | @Column(name= "TASK_CODE_ID")
13 | private Long Id;
14 |
15 | @OneToOne(mappedBy = "code")
16 | private TaskEntity task;
17 |
18 | public void setId(Long id) {
19 | Id = id;
20 | }
21 |
22 | public Long getId() {
23 | return Id;
24 | }
25 |
26 | public TaskEntity getTask() {
27 | return task;
28 | }
29 |
30 | public void setTask(TaskEntity task) {
31 | this.task = task;
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/task/TaskIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.task;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 | import javax.persistence.*;
5 |
6 | @Entity
7 | @Table(name="TaskIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_TASK_IDENTIFIER", columnNames={"TASK_IDENTIFIER_ID"})
8 | ,indexes = {}
9 | )
10 | public class TaskIdentifier extends BaseIdentifier {
11 |
12 | public TaskIdentifier() {
13 | }
14 | public TaskIdentifier(TaskEntity task) {
15 | this.task = task;
16 | }
17 |
18 |
19 | @Id
20 | @GeneratedValue(strategy = GenerationType.IDENTITY)
21 | @Column(name= "TASK_IDENTIFIER_ID")
22 | private Long identifierId;
23 |
24 | @ManyToOne(fetch = FetchType.LAZY)
25 | @JoinColumn (name = "TASK_ID",foreignKey= @ForeignKey(name="FK_TASK_IDENTIFIER_TASK_ID"))
26 | private TaskEntity task;
27 |
28 | @Column(name ="GROUP_IDENTIFIER")
29 | private Boolean group;
30 |
31 | public Boolean getGroup() {
32 | return group;
33 | }
34 |
35 | public void setGroup(Boolean group) {
36 | this.group = group;
37 | }
38 |
39 | public Long getIdentifierId() { return identifierId; }
40 | public void setIdentifierId(Long identifierId) { this.identifierId = identifierId; }
41 |
42 | public TaskEntity getTask() {
43 | return task;
44 | }
45 |
46 | public void setTask(TaskEntity task) {
47 | this.task = task;
48 | }
49 |
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/valueSet/ValueSetIdentifier.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.valueSet;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseIdentifier;
4 |
5 | import javax.persistence.*;
6 |
7 |
8 | @Entity
9 | @Table(name="ValueSetIdentifier", uniqueConstraints= @UniqueConstraint(name="PK_VALUESET_IDENTIFIER", columnNames={"VALUESET_IDENTIFIER_ID"}))
10 | public class ValueSetIdentifier extends BaseIdentifier {
11 |
12 | public ValueSetIdentifier() {
13 |
14 | }
15 |
16 | public ValueSetIdentifier(ValueSetEntity valueSetEntity) {
17 | this.valueSetEntity = valueSetEntity;
18 | }
19 |
20 |
21 | @Id
22 | @GeneratedValue(strategy = GenerationType.IDENTITY)
23 | @Column(name= "VALUESET_IDENTIFIER_ID")
24 | private Integer identifierId;
25 |
26 | @ManyToOne(fetch = FetchType.LAZY)
27 | @JoinColumn (name = "VALUESET_ID",foreignKey= @ForeignKey(name="FK_VALUESET_VALUESET_IDENTIFIER"))
28 | private ValueSetEntity valueSetEntity;
29 |
30 |
31 |
32 | public Integer getIdentifierId() { return identifierId; }
33 | public void setIdentifierId(Integer identifierId) { this.identifierId = identifierId; }
34 |
35 | public ValueSetEntity getValueSetEntity() {
36 | return this.valueSetEntity;
37 | }
38 | public void setValueSetEntity(ValueSetEntity valueSetEntity) {
39 | this.valueSetEntity = valueSetEntity;
40 | }
41 |
42 |
43 | }
44 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/valueSet/ValueSetIncludeConcept.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.valueSet;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.codeSystem.ConceptEntity;
4 |
5 | import javax.persistence.*;
6 |
7 |
8 | @Entity
9 | @Table(name="ValueSetIncludeConcept")
10 | public class ValueSetIncludeConcept {
11 |
12 |
13 | public ValueSetIncludeConcept() {
14 |
15 | }
16 |
17 |
18 | @Id
19 | @GeneratedValue(strategy = GenerationType.IDENTITY)
20 | @Column(name= "VALUESET_INCLUDE_CONCEPT_ID")
21 | private Integer contentId;
22 |
23 | @ManyToOne(fetch = FetchType.LAZY)
24 | @JoinColumn(name="CONCEPT_ID")
25 | private ConceptEntity concept;
26 |
27 | @ManyToOne(fetch = FetchType.LAZY)
28 | @JoinColumn(name="VALUESET_INCLUDE_ID")
29 | private ValueSetInclude include;
30 |
31 | public ConceptEntity getConcept() {
32 | return concept;
33 | }
34 |
35 | public ValueSetInclude getInclude() {
36 | return include;
37 | }
38 |
39 | public Integer getId() {
40 | return contentId;
41 | }
42 |
43 | public void setConcept(ConceptEntity concept) {
44 | this.concept = concept;
45 | }
46 |
47 | public void setId(Integer contentId) {
48 | this.contentId = contentId;
49 | }
50 |
51 | public void setInclude(ValueSetInclude include) {
52 | this.include = include;
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/ccri-database/src/main/java/uk/nhs/careconnect/ri/database/entity/valueSet/ValueSetTelecom.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ri.database.entity.valueSet;
2 |
3 | import uk.nhs.careconnect.ri.database.entity.BaseContactPoint;
4 | import uk.nhs.careconnect.ri.database.entity.valueSet.ValueSetEntity;
5 |
6 | import javax.persistence.*;
7 |
8 |
9 | @Entity
10 | @Table(name="ValueSetTelecom", uniqueConstraints= @UniqueConstraint(name="PK_VALUESET_TELECOM", columnNames={"VALUESET_TELECOM_ID"})
11 | ,indexes =
12 | {
13 | @Index(name = "IDX_VALUESET_TELECOM", columnList="CONTACT_VALUE,SYSTEM_ID"),
14 | @Index(name = "IDX_VALUESET_TELECOM_VALUESET_ID", columnList="VALUESET_ID")
15 | })
16 | public class ValueSetTelecom extends BaseContactPoint {
17 |
18 | public ValueSetTelecom() {
19 |
20 | }
21 |
22 | @Id
23 | @GeneratedValue(strategy = GenerationType.IDENTITY)
24 | @Column(name= "VALUESET_TELECOM_ID")
25 | private Long telecomId;
26 |
27 | @ManyToOne(fetch = FetchType.LAZY)
28 | @JoinColumn (name = "VALUESET_ID",foreignKey= @ForeignKey(name="FK_VALUESET_TELECOM_VALUESET_ID"))
29 | private ValueSetEntity valueSet;
30 |
31 | public Long getTelecomId() {
32 | return telecomId;
33 | }
34 |
35 | public void setTelecomId(Long telecomId) {
36 | this.telecomId = telecomId;
37 | }
38 |
39 | public ValueSetEntity getValueSet() {
40 | return valueSet;
41 | }
42 |
43 | public void setValueSet(ValueSetEntity valueSet) {
44 | this.valueSet = valueSet;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common/V1.6__Sample Patient.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO Patient (PATIENT_ID,RES_DELETED,RES_CREATED,RES_MESSAGE_REF,RES_UPDATED,date_of_birth,gender,registration_end,registration_start,NHSverification,ethnic,GP_ID,marital,PRACTICE_ID)
2 | VALUES (1,NULL,NULL,NULL,NULL,'1998-03-19','FEMALE',NULL,NULL,79,11,1,7,1);
3 |
4 | INSERT INTO PatientName (PATIENT_ID,PATIENT_NAME_ID,family_name,given_name,prefix,nameUse)
5 | VALUES (1,1,'Kanfeld','Bernie','Miss',0);
6 |
7 |
8 | INSERT INTO PatientIdentifier
9 | (PATIENT_IDENTIFIER_ID,IDENTIFIER_VALUE,SYSTEM_ID,PATIENT_ID)
10 | VALUES (1,'9876543210', 1, 1);
11 | INSERT INTO PatientIdentifier(PATIENT_IDENTIFIER_ID,IDENTIFIER_VALUE,SYSTEM_ID,PATIENT_ID)
12 | VALUES(2,'ABC8650149', 1001, 1);
13 |
14 |
15 | INSERT INTO PatientTelecom(PATIENT_TELECOM_ID,CONTACT_VALUE,TELECOM_USE,SYSTEM_ID,PATIENT_ID)
16 | VALUES (1,'0115 9737320',0, 0, 1);
17 | INSERT INTO PatientTelecom (PATIENT_TELECOM_ID,SYSTEM_ID,TELECOM_USE,CONTACT_VALUE,PATIENT_ID)
18 | VALUES (2,2,0,'bernie.kanfeld@nhsdigital.nhs.uk',1);
19 |
20 |
21 | INSERT INTO PatientAddress (PATIENT_ADDRESS_ID,ADDRESS_ID,PATIENT_ID,addressUse)
22 | VALUES(1,5,1,1);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common/V1.7__Sample Location.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO Location (LOCATION_ID,RES_DELETED,RES_CREATED,RES_MESSAGE_REF,RES_UPDATED,ENT_NAME,status,MANAGING_ORGANISATION_ID,physicalType,TYPE_CONCEPT_ID)
3 | VALUES (1,NULL,NULL,NULL,NULL,'Long Eaton Clinic',0,2,479,463);
4 |
5 | INSERT INTO LocationTelecom (LOCATION_TELECOM_ID,SYSTEM_ID,TELECOM_USE,CONTACT_VALUE,LOCATION_ID) VALUES (1,0,1,'0115 855 4034',1);
6 | INSERT INTO LocationTelecom (LOCATION_TELECOM_ID,SYSTEM_ID,TELECOM_USE,CONTACT_VALUE,LOCATION_ID) VALUES (2,1,1,'0532 123 4567',1);
7 |
8 | INSERT INTO LocationIdentifier (LOCATION_IDENTIFIER_ID,identifierUse,listOrder,IDENTIFIER_VALUE,SYSTEM_ID,LOCATION_ID) VALUES (1,0,NULL,'RTG08',2,1);
9 |
10 | INSERT INTO LocationAddress (LOCATION_ADDRESS_ID,addressType,addressUse,ADDRESS_ID,LOCATION_ID) VALUES (1,0,0,6,1);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V1.6__Sample Patient.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO Patient (PATIENT_ID,RES_DELETED,RES_CREATED,RES_MESSAGE_REF,RES_UPDATED,date_of_birth,gender,registration_end,registration_start,NHSverification,ethnic,GP_ID,marital,PRACTICE_ID)
2 | VALUES (1,NULL,NULL,NULL,NULL,'1998-03-19','FEMALE',NULL,NULL,79,11,1,7,1);
3 |
4 | INSERT INTO PatientName (PATIENT_ID,PATIENT_NAME_ID,family_name,given_name,prefix,nameUse)
5 | VALUES (1,1,'Kanfeld','Bernie','Miss',0);
6 |
7 |
8 | INSERT INTO PatientIdentifier
9 | (PATIENT_IDENTIFIER_ID,IDENTIFIER_VALUE,SYSTEM_ID,PATIENT_ID)
10 | VALUES (1,'9876543210', 1, 1);
11 | INSERT INTO PatientIdentifier(PATIENT_IDENTIFIER_ID,IDENTIFIER_VALUE,SYSTEM_ID,PATIENT_ID)
12 | VALUES(2,'ABC8650149', 1001, 1);
13 |
14 |
15 | INSERT INTO PatientTelecom(PATIENT_TELECOM_ID,CONTACT_VALUE,TELECOM_USE,SYSTEM_ID,PATIENT_ID)
16 | VALUES (1,'0115 9737320',0, 0, 1);
17 | INSERT INTO PatientTelecom (PATIENT_TELECOM_ID,SYSTEM_ID,TELECOM_USE,CONTACT_VALUE,PATIENT_ID)
18 | VALUES (2,2,0,'bernie.kanfeld@nhsdigital.nhs.uk',1);
19 |
20 |
21 | INSERT INTO PatientAddress (PATIENT_ADDRESS_ID,ADDRESS_ID,PATIENT_ID,addressUse)
22 | VALUES(1,5,1,1);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V1.7__Sample Location.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO Location (LOCATION_ID,RES_DELETED,RES_CREATED,RES_MESSAGE_REF,RES_UPDATED,ENT_NAME,status,MANAGING_ORGANISATION_ID,physicalType,TYPE_CONCEPT_ID)
3 | VALUES (1,NULL,NULL,NULL,NULL,'Long Eaton Clinic',0,2,479,463);
4 |
5 | INSERT INTO LocationTelecom (LOCATION_TELECOM_ID,SYSTEM_ID,TELECOM_USE,CONTACT_VALUE,LOCATION_ID) VALUES (1,0,1,'0115 855 4034',1);
6 | INSERT INTO LocationTelecom (LOCATION_TELECOM_ID,SYSTEM_ID,TELECOM_USE,CONTACT_VALUE,LOCATION_ID) VALUES (2,1,1,'0532 123 4567',1);
7 |
8 | INSERT INTO LocationIdentifier (LOCATION_IDENTIFIER_ID,identifierUse,listOrder,IDENTIFIER_VALUE,SYSTEM_ID,LOCATION_ID) VALUES (1,0,NULL,'RTG08',2,1);
9 |
10 | INSERT INTO LocationAddress (LOCATION_ADDRESS_ID,addressType,addressUse,ADDRESS_ID,LOCATION_ID) VALUES (1,0,0,6,1);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V3.8__CodeSystemModification.sql:
--------------------------------------------------------------------------------
1 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CareConnect-EthnicCategory-1' where CODESYSTEM_ID=2;
2 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CareConnect-NHSNumberVerificationStatus-1' where CODESYSTEM_ID=3;
3 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CareConnect-SDSJobRoleName-1' where CODESYSTEM_ID=7;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.10__R2_DataLoadSupport_4.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1007,'https://fhir.leedsth.nhs.uk/Id/immunisation','Leeds TH Immunisation Id');
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.11__R2_DataLoadSupport_5.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO CodeSystem (CODESYSTEM_ID,CODE_SYSTEM_URI,CODESYSTEM_NAME)
4 | VALUES(938,'http://hl7.org/fhir/immunization-origin','Immunization Origin Codes');
5 |
6 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
7 | VALUES('provider','Other Provider',938);
8 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
9 | VALUES('record','Written Record',938);
10 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
11 | VALUES('recall','Parent/Guardian/Patient Recall',938);
12 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
13 | VALUES('school','School Record',938);
14 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.12__R2_DataLoadSupport_6.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1008,'https://fhir.leedsth.nhs.uk/Id/procedure','Leeds TH Procedure Id');
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.13__R2_DataLoadSupport_7.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO MedicationRequest(PRESCRIPTION_ID,authoredDate,intent,priority,status,substitutionAllowed,writtenDate,CATEGORY_CONCEPT,ENCOUNTER_ID,EPISODE_ID,MEDICATION_CODE_CONCEPT_ID,PATIENT_ID,REASON_CONCEPT,REASON_CONDITION,REASON_OBSERVATION,RECORDER_PRACTITIONER)
2 | SELECT 1,'2017-05-25 00:00:00',2,0,3,true,'2017-05-25 00:00:00',NULL,1,1,CONCEPT_ID,1,NULL,NULL,NULL,1 FROM Concept where CODE = '10097211000001102' ;
3 |
4 | INSERT INTO MedicationRequestDosage (PRESCRIPTION_DOSAGE_ID,asNeededBoolean,doseQuantity,doseRangeHigh,doseRangeLow,otherText,patientInstruction,sequence,ADDITIONAL_INSTRUCTION_CONCEPT,ASNEEDED_CONCEPT,DOSE_UNITS_CONCEPT,METHOD_CONCEPT,PRESCRIPTION_ID,ROUTE_CONCEPT,SITE_CONCEPT)
5 | SELECT 1,false,null,null,null,'Please explain to Bernie how to use injector.','Three times a day',null,CONCEPT_ID,null,null,null,1,null,null FROM Concept where CODE = '1521000175104' ;
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.14__R2_DataLoadSupport_8.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1009,'https://fhir.leedsth.nhs.uk/Id/PPMIdentifier','Leeds TH PPM Patient Id');
4 |
5 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1010,'https://fhir.leedsth.nhs.uk/Id/observation','Leeds TH Observation Id');
6 |
7 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1011,'https://fhir.health.phr.example.com/Id/observation','PHR Observations');
8 |
9 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.15__R2_DataLoadSupport_9.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
2 | VALUES ('41950-7','Number of steps in 24 hour Measured',64);
3 |
4 |
5 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
6 | VALUES ('41979-6','Calories burned in 24 hour Calculated',64);
7 |
8 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
9 | VALUES ('41981-2','Calories burned',64);
10 |
11 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.16__R2_DataLoadSupport_10.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1012,'https://fhir.leedsth.nhs.uk/Id/prescription','Leeds TH PPM Prescription');
4 |
5 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.17__R2_DataLoadSupport_11.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
2 | VALUES ('732936001','Tablet (unit of presentation)',9);
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.18__PractionerEmail.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO PractitionerTelecom(CONTACT_VALUE,TELECOM_USE,SYSTEM_ID,PRACTITIONER_ID)
2 | VALUES ('abhatia@nhs.skynet',1, 2, 1);
3 | INSERT INTO PractitionerTelecom(CONTACT_VALUE,TELECOM_USE,SYSTEM_ID,PRACTITIONER_ID)
4 | VALUES ('karen.swamp@nhs.skynet',1, 2, 2);
5 | INSERT INTO PractitionerTelecom(CONTACT_VALUE,TELECOM_USE,SYSTEM_ID,PRACTITIONER_ID)
6 | VALUES('ripley.amber@nhs.skynet',1, 2, 3);
7 |
8 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.19__v3ActCode.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO CodeSystem (CODESYSTEM_ID,CODE_SYSTEM_URI,CODESYSTEM_NAME)
3 | VALUES (950,'http://hl7.org/fhir/v3-ActEncounterCode',NULL);
4 |
5 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('AMB','ambulatory',950);
6 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('EMER','emergency',950);
7 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('FLD','field',950);
8 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('HH','home health',950);
9 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('IMP','inpatient encounter',950);
10 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('ACUTE',' inpatient acute',950);
11 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('NONAC','inpatient non-acute',950);
12 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('PRENC','pre-admission',950);
13 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('SS','short stay',950);
14 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('VR','virtual',950);
15 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.20__snomedSection.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('1082101000000102','Investigation results (record artifact)',9);
3 |
4 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.21__conditionCategory.sql:
--------------------------------------------------------------------------------
1 |
2 | update Concept set CODE= 'encounter-diagnosis', DISPLAY = 'Encounter Diagnosis' where CODE = 'diagnosis' AND CODESYSTEM_ID=15;
3 | update Concept set CODE= 'presenting-complaint', DISPLAY = 'Presenting Complaint' where CODE = 'complaint' AND CODESYSTEM_ID=15;
4 | update Concept set CODE= 'issue', DISPLAY = 'issue' where CODE = 'Issue' AND CODESYSTEM_ID=15;
5 | update Concept set CODE= 'deleted', DISPLAY = 'Removed' where CODE = 'need' AND CODESYSTEM_ID=15;
6 | update Concept set CODE= 'problem-list-item', DISPLAY = 'Problem List Item' where CODE = 'problem' AND CODESYSTEM_ID=15;
7 | update Concept set CODE= 'co-morbidity', DISPLAY = 'Co-morbidity' where CODE = 'symptom' AND CODESYSTEM_ID=15;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.22__mentalhealthcrisisplan.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('736253002','Mental health crisis plan (record artifact) ',9);
3 |
4 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.2__CodeSystemModification.sql:
--------------------------------------------------------------------------------
1 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-EthnicCategory-1' where CODESYSTEM_ID=2;
2 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-NHSNumberVerificationStatus-1' where CODESYSTEM_ID=3;
3 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1' where CODESYSTEM_ID=7;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.6__R2_DataLoadSupport_1.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1004,'https://fhir.leedsth.nhs.uk/Id/encounter','Leeds TH Encounter Id');
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1005,'https://fhir.leedsth.nhs.uk/Id/condition','Leeds TH Condition Id');
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.7__R2_DataLoadSupport_2.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO CodeSystem (CODESYSTEM_ID,CODE_SYSTEM_URI,CODESYSTEM_NAME)
4 | VALUES(937,'http://hl7.org/fhir/ValueSet/encounter-participant-type','ParticipantType');
5 |
6 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
7 | VALUES('PPRF','primary performer',937);
8 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
9 | VALUES('ADM','admitter',937);
10 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
11 | VALUES('ATND','attender',937);
12 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
13 | VALUES('CALLBCK','callback contact',937);
14 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
15 | VALUES('CON','consultant',937);
16 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
17 | VALUES('DIS','discharger',937);
18 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
19 | VALUES('ESC','escort',937);
20 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
21 | VALUES('REF','referrer',937);
22 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
23 | VALUES('SPRF','secondary performer',937);
24 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
25 | VALUES('PART','Participant',937);
26 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
27 | VALUES('translator','translator',937);
28 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
29 | VALUES('emergency','emergency',937);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.8__R2_DataLoadSupport_3.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1006,'https://fhir.leedsth.nhs.uk/Id/allergy','Leeds TH Allergy Id');
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/common2BDeleted/V4.9__R2_DataLoadSupport_4.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO Immunisation
2 | (IMMUNISATION_ID,administrationDateTime,expirationDateTime,lotNumber,notGiven,note,parentPresent,primarySource,recordedDateTime,STATUS_ID,valueQuantity,ENCOUNTER_ID,LOCATION_ID,MANUFACTURER_ORGANISATION_ID,PATIENT_ID,PRACTITIONER_ID,REASON_GIVEN_CODE_ID,REASON_NOTGIVEN_CODE_ID,REPORT_ORIGIN_CODE_ID,ROUTE_CODE_ID,SITE_CODE_ID,MEDICATION_CODE_ID,valueUnitOfMeasure_CONCEPT_ID)
3 | select 1,'2016-03-01 09:30:00','2020-01-01','63259874',false,null,null, true,'2016-03-01 09:30:00',0,null,1,1,null,1,1,null,null,null,null,null,CONCEPT_ID,null FROM Concept where CODE = '396429000' ;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/otherScripts/ClearDown AllergyIntolerance.sql:
--------------------------------------------------------------------------------
1 | use careconnect;
2 |
3 | SET SQL_SAFE_UPDATES = 0;
4 |
5 | delete from AllergyIntoleranceManifestation where ALLERGY_REACTION_ID > 2;
6 | delete from AllergyIntoleranceReaction where ALLERGY_ID > 2;
7 |
8 | delete from AllergyIntoleranceIdentifier where ALLERGY_ID > 2;
9 | delete from AllergyIntoleranceCategory where ALLERGY_ID > 2;
10 | delete from AllergyIntolerance where ALLERGY_ID > 2;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/otherScripts/ClearDown Clinical.sql:
--------------------------------------------------------------------------------
1 | use careconnect;
2 |
3 | SET SQL_SAFE_UPDATES = 0;
4 |
5 |
6 | delete from ImmunizationIdentifier where IMMUNISATION_ID > 1;
7 | delete from Immunisation where IMMUNISATION_ID > 1;
8 |
9 |
10 | delete from `EncounterIdentifier` WHERE ENCOUNTER_ID > 3;
11 | delete from `Encounter` WHERE ENCOUNTER_ID > 3;
12 |
13 | delete from `ProcedureIdentifier` WHERE PROCEDURE_ID > 2;
14 | delete from `ProcedurePerformer` WHERE PROCEDURE_ID > 2;
15 | delete from `Procedure_` WHERE PROCEDURE_ID > 2;
16 |
17 | delete from ConditionCategory WHERE CONDITION_ID > 2;
18 | delete from ConditionIdentifier WHERE CONDITION_ID > 2;
19 |
20 | delete from Condition_ WHERE CONDITION_ID > 2;
21 |
22 |
23 | delete from MedicationRequestDosage where PRESCRIBING_ID>1;
24 | delete from MedicationRequestIdentifier where PRESCRIBING_ID>1;
25 | delete from MedicationRequest where PRESCRIBING_ID>1;
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/otherScripts/ClearDown DocumentReference.sql:
--------------------------------------------------------------------------------
1 | delete FROM DocumentReferenceAuthor where DOCUMENT_REFERENCE_ID >0;
2 | delete FROM DocumentReferenceAttachment where DOCUMENT_REFERENCE_ID>0;
3 | delete FROM DocumentReferenceIdentifier where DOCUMENT_REFERENCE_ID>0;
4 | delete FROM DocumentReference where DOCUMENT_REFERENCE_ID>0;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/otherScripts/ClearDown Observations.sql:
--------------------------------------------------------------------------------
1 | truncate careconnect.ObservationCategory;
2 |
3 | truncate careconnect.ObservationPerformer;
4 |
5 | truncate careconnect.ObservationRange;
6 |
7 | truncate careconnect.ObservationIdentifier;
8 |
9 | delete from careconnect.Observation where PARENT_OBSERVATION_ID is not null;
10 |
11 | SET SQL_SAFE_UPDATES = 0;
12 |
13 |
14 | delete from careconnect.Observation ;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/otherScripts/ClearDown Patient Observations.sql:
--------------------------------------------------------------------------------
1 | SET SQL_SAFE_UPDATES = 0;
2 |
3 | delete from ObservationCategory where OBSERVATION_ID in (select OBSERVATION_ID from Observation where PATIENT_ID = 1186);
4 | delete from ObservationIdentifier where OBSERVATION_ID in (select OBSERVATION_ID from Observation where PATIENT_ID = 1186);
5 | delete from ObservationPerformer where OBSERVATION_ID in (select OBSERVATION_ID from Observation where PATIENT_ID = 1186);
6 |
7 | delete from Observation where PATIENT_ID = 1186 and PARENT_OBSERVATION_ID is not null;
8 | delete from Observation where PATIENT_ID = 1186 and PARENT_OBSERVATION_ID is null;
9 |
10 | delete from EncounterIdentifier where ENCOUNTER_ID in (select ENCOUNTER_ID from Encounter where PATIENT_ID = 1186);
11 | delete from Encounter where PATIENT_ID = 1186
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V1.6__Sample Patient.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO Patient (PATIENT_ID,RES_DELETED,RES_CREATED,RES_MESSAGE_REF,RES_UPDATED,date_of_birth,gender,registration_end,registration_start,NHSverification,ethnic,GP_ID,marital,PRACTICE_ID)
2 | VALUES (1,NULL,NULL,NULL,NULL,'1998-03-19','FEMALE',NULL,NULL,79,11,1,7,1);
3 |
4 | INSERT INTO PatientName (PATIENT_ID,PATIENT_NAME_ID,family_name,given_name,prefix,nameUse)
5 | VALUES (1,1,'Kanfeld','Bernie','Miss',0);
6 |
7 |
8 | INSERT INTO PatientIdentifier
9 | (PATIENT_IDENTIFIER_ID,IDENTIFIER_VALUE,SYSTEM_ID,PATIENT_ID)
10 | VALUES (1,'9876543210', 1, 1);
11 | INSERT INTO PatientIdentifier(PATIENT_IDENTIFIER_ID,IDENTIFIER_VALUE,SYSTEM_ID,PATIENT_ID)
12 | VALUES(2,'ABC8650149', 1001, 1);
13 |
14 |
15 | INSERT INTO PatientTelecom(PATIENT_TELECOM_ID,CONTACT_VALUE,TELECOM_USE,SYSTEM_ID,PATIENT_ID)
16 | VALUES (1,'0115 9737320',0, 0, 1);
17 | INSERT INTO PatientTelecom (PATIENT_TELECOM_ID,SYSTEM_ID,TELECOM_USE,CONTACT_VALUE,PATIENT_ID)
18 | VALUES (2,2,0,'bernie.kanfeld@nhsdigital.nhs.uk',1);
19 |
20 |
21 | INSERT INTO PatientAddress (PATIENT_ADDRESS_ID,ADDRESS_ID,PATIENT_ID,addressUse)
22 | VALUES(1,5,1,1);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V1.7__Sample Location.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO Location (LOCATION_ID,RES_DELETED,RES_CREATED,RES_MESSAGE_REF,RES_UPDATED,ENT_NAME,status,MANAGING_ORGANISATION_ID,physicalType,TYPE_CONCEPT_ID)
3 | VALUES (1,NULL,NULL,NULL,NULL,'Long Eaton Clinic',0,2,479,463);
4 |
5 | INSERT INTO LocationTelecom (LOCATION_TELECOM_ID,SYSTEM_ID,TELECOM_USE,CONTACT_VALUE,LOCATION_ID) VALUES (1,0,1,'0115 855 4034',1);
6 | INSERT INTO LocationTelecom (LOCATION_TELECOM_ID,SYSTEM_ID,TELECOM_USE,CONTACT_VALUE,LOCATION_ID) VALUES (2,1,1,'0532 123 4567',1);
7 |
8 | INSERT INTO LocationIdentifier (LOCATION_IDENTIFIER_ID,identifierUse,listOrder,IDENTIFIER_VALUE,SYSTEM_ID,LOCATION_ID) VALUES (1,0,NULL,'RTG08',2,1);
9 |
10 | INSERT INTO LocationAddress (LOCATION_ADDRESS_ID,addressType,addressUse,ADDRESS_ID,LOCATION_ID) VALUES (1,0,0,6,1);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V3.8__CodeSystemModification.sql:
--------------------------------------------------------------------------------
1 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CareConnect-EthnicCategory-1' where CODESYSTEM_ID=2;
2 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CareConnect-NHSNumberVerificationStatus-1' where CODESYSTEM_ID=3;
3 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CareConnect-SDSJobRoleName-1' where CODESYSTEM_ID=7;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.10__R2_DataLoadSupport_4.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1007,'https://fhir.leedsth.nhs.uk/Id/immunisation','Leeds TH Immunisation Id');
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.11__R2_DataLoadSupport_5.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO CodeSystem (CODESYSTEM_ID,CODE_SYSTEM_URI,CODESYSTEM_NAME)
4 | VALUES(938,'http://hl7.org/fhir/immunization-origin','Immunization Origin Codes');
5 |
6 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
7 | VALUES('provider','Other Provider',938);
8 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
9 | VALUES('record','Written Record',938);
10 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
11 | VALUES('recall','Parent/Guardian/Patient Recall',938);
12 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
13 | VALUES('school','School Record',938);
14 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.12__R2_DataLoadSupport_6.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1008,'https://fhir.leedsth.nhs.uk/Id/procedure','Leeds TH Procedure Id');
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.13__R2_DataLoadSupport_7.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO MedicationRequest(PRESCRIPTION_ID,authoredDate,intent,priority,status,substitutionAllowed,writtenDate,CATEGORY_CONCEPT,ENCOUNTER_ID,EPISODE_ID,MEDICATION_CODE_CONCEPT_ID,PATIENT_ID,REASON_CONCEPT,REASON_CONDITION,REASON_OBSERVATION,RECORDER_PRACTITIONER)
2 | SELECT 1,'2017-05-25 00:00:00',2,0,3,true,'2017-05-25 00:00:00',NULL,1,1,CONCEPT_ID,1,NULL,NULL,NULL,1 FROM Concept where CODE = '10097211000001102' ;
3 |
4 | INSERT INTO MedicationRequestDosage (PRESCRIPTION_DOSAGE_ID,asNeededBoolean,doseQuantity,doseRangeHigh,doseRangeLow,otherText,patientInstruction,sequence,ADDITIONAL_INSTRUCTION_CONCEPT,ASNEEDED_CONCEPT,DOSE_UNITS_CONCEPT,METHOD_CONCEPT,PRESCRIPTION_ID,ROUTE_CONCEPT,SITE_CONCEPT)
5 | SELECT 1,false,null,null,null,'Please explain to Bernie how to use injector.','Three times a day',null,CONCEPT_ID,null,null,null,1,null,null FROM Concept where CODE = '1521000175104' ;
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.14__R2_DataLoadSupport_8.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1009,'https://fhir.leedsth.nhs.uk/Id/PPMIdentifier','Leeds TH PPM Patient Id');
4 |
5 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1010,'https://fhir.leedsth.nhs.uk/Id/observation','Leeds TH Observation Id');
6 |
7 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1011,'https://fhir.health.phr.example.com/Id/observation','PHR Observations');
8 |
9 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.15__R2_DataLoadSupport_9.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
2 | VALUES ('41950-7','Number of steps in 24 hour Measured',64);
3 |
4 |
5 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
6 | VALUES ('41979-6','Calories burned in 24 hour Calculated',64);
7 |
8 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
9 | VALUES ('41981-2','Calories burned',64);
10 |
11 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.16__R2_DataLoadSupport_10.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1012,'https://fhir.leedsth.nhs.uk/Id/prescription','Leeds TH PPM Prescription');
4 |
5 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.17__R2_DataLoadSupport_11.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
2 | VALUES ('732936001','Tablet (unit of presentation)',9);
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.18__PractionerEmail.sql:
--------------------------------------------------------------------------------
1 |
2 | LOCK TABLE practitionertelecom IN EXCLUSIVE MODE;
3 | SELECT setval('practitionertelecom_practitioner_telecom_id_seq', COALESCE((SELECT MAX(practitioner_telecom_id)+1 FROM practitionertelecom), 1), false)
4 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
5 |
6 | INSERT INTO PractitionerTelecom(CONTACT_VALUE,TELECOM_USE,SYSTEM_ID,PRACTITIONER_ID)
7 | VALUES ('abhatia@nhs.skynet',1, 2, 1);
8 | INSERT INTO PractitionerTelecom(CONTACT_VALUE,TELECOM_USE,SYSTEM_ID,PRACTITIONER_ID)
9 | VALUES ('karen.swamp@nhs.skynet',1, 2, 2);
10 | INSERT INTO PractitionerTelecom(CONTACT_VALUE,TELECOM_USE,SYSTEM_ID,PRACTITIONER_ID)
11 | VALUES('ripley.amber@nhs.skynet',1, 2, 3);
12 |
13 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.19__v3ActCode.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO CodeSystem (CODESYSTEM_ID,CODE_SYSTEM_URI,CODESYSTEM_NAME)
3 | VALUES (950,'http://hl7.org/fhir/v3-ActEncounterCode',NULL);
4 |
5 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('AMB','ambulatory',950);
6 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('EMER','emergency',950);
7 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('FLD','field',950);
8 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('HH','home health',950);
9 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('IMP','inpatient encounter',950);
10 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('ACUTE',' inpatient acute',950);
11 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('NONAC','inpatient non-acute',950);
12 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('PRENC','pre-admission',950);
13 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('SS','short stay',950);
14 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('VR','virtual',950);
15 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.20__snomedSection.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('1082101000000102','Investigation results (record artifact)',9);
3 |
4 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.21__conditionCategory.sql:
--------------------------------------------------------------------------------
1 |
2 | update Concept set CODE= 'encounter-diagnosis', DISPLAY = 'Encounter Diagnosis' where CODE = 'diagnosis' AND CODESYSTEM_ID=15;
3 | update Concept set CODE= 'presenting-complaint', DISPLAY = 'Presenting Complaint' where CODE = 'complaint' AND CODESYSTEM_ID=15;
4 | update Concept set CODE= 'issue', DISPLAY = 'issue' where CODE = 'Issue' AND CODESYSTEM_ID=15;
5 | update Concept set CODE= 'deleted', DISPLAY = 'Removed' where CODE = 'need' AND CODESYSTEM_ID=15;
6 | update Concept set CODE= 'problem-list-item', DISPLAY = 'Problem List Item' where CODE = 'problem' AND CODESYSTEM_ID=15;
7 | update Concept set CODE= 'co-morbidity', DISPLAY = 'Co-morbidity' where CODE = 'symptom' AND CODESYSTEM_ID=15;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.22__mentalhealthcrisisplan.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO Concept(CODE,DISPLAY,CODESYSTEM_ID) VALUES ('736253002','Mental health crisis plan (record artifact) ',9);
3 |
4 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.2__CodeSystemModification.sql:
--------------------------------------------------------------------------------
1 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-EthnicCategory-1' where CODESYSTEM_ID=2;
2 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-NHSNumberVerificationStatus-1' where CODESYSTEM_ID=3;
3 | update CodeSystem set CODE_SYSTEM_URI ='https://fhir.hl7.org.uk/STU3/CodeSystem/CareConnect-SDSJobRoleName-1' where CODESYSTEM_ID=7;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.6__R2_DataLoadSupport_1.sql:
--------------------------------------------------------------------------------
1 |
2 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1004,'https://fhir.leedsth.nhs.uk/Id/encounter','Leeds TH Encounter Id');
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1005,'https://fhir.leedsth.nhs.uk/Id/condition','Leeds TH Condition Id');
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.7__R2_DataLoadSupport_2.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO CodeSystem (CODESYSTEM_ID,CODE_SYSTEM_URI,CODESYSTEM_NAME)
4 | VALUES(937,'http://hl7.org/fhir/ValueSet/encounter-participant-type','ParticipantType');
5 |
6 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
7 | VALUES('PPRF','primary performer',937);
8 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
9 | VALUES('ADM','admitter',937);
10 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
11 | VALUES('ATND','attender',937);
12 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
13 | VALUES('CALLBCK','callback contact',937);
14 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
15 | VALUES('CON','consultant',937);
16 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
17 | VALUES('DIS','discharger',937);
18 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
19 | VALUES('ESC','escort',937);
20 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
21 | VALUES('REF','referrer',937);
22 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
23 | VALUES('SPRF','secondary performer',937);
24 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
25 | VALUES('PART','Participant',937);
26 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
27 | VALUES('translator','translator',937);
28 | INSERT INTO Concept (CODE,DISPLAY,CODESYSTEM_ID)
29 | VALUES('emergency','emergency',937);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.8__R2_DataLoadSupport_3.sql:
--------------------------------------------------------------------------------
1 |
2 |
3 | INSERT INTO System (SYSTEM_ID,SYSTEM_URI,SYSTEM_NAME) VALUES (1006,'https://fhir.leedsth.nhs.uk/Id/allergy','Leeds TH Allergy Id');
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V4.9__R2_DataLoadSupport_4.sql:
--------------------------------------------------------------------------------
1 | INSERT INTO Immunisation
2 | (IMMUNISATION_ID,administrationDateTime,expirationDateTime,lotNumber,notGiven,note,parentPresent,primarySource,recordedDateTime,STATUS_ID,valueQuantity,ENCOUNTER_ID,LOCATION_ID,MANUFACTURER_ORGANISATION_ID,PATIENT_ID,PRACTITIONER_ID,REASON_GIVEN_CODE_ID,REASON_NOTGIVEN_CODE_ID,REPORT_ORIGIN_CODE_ID,ROUTE_CODE_ID,SITE_CODE_ID,MEDICATION_CODE_ID,valueUnitOfMeasure_CONCEPT_ID)
3 | select 1,'2016-03-01 09:30:00','2020-01-01','63259874',false,null,null, true,'2016-03-01 09:30:00',0,null,1,1,null,1,1,null,null,null,null,null,CONCEPT_ID,null FROM Concept where CODE = '396429000' ;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.10__UpdateDisplayTerm.sql:
--------------------------------------------------------------------------------
1 | update Concept as c
2 | set DISPLAY = d.term
3 | from ConceptDesignation as d where c.CONCEPT_ID = d.CONCEPT_ID
4 | and designationUse=0;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.11__PopulateRelationShip.sql:
--------------------------------------------------------------------------------
1 | -- isA only
2 |
3 | insert into ConceptParentChildLink(relationshipId,REL_TYPE,CHILD_CONCEPT_ID,PARENT_CONCEPT_ID,CODESYSTEM_ID)
4 | select r.id,0,s.CONCEPT_ID,d.CONCEPT_ID, 9
5 | from tempRelationship r
6 | join Concept s on r.sourceId = s.CODE and s.CODESYSTEM_ID = 9
7 | join Concept d on r.destinationId = d.CODE and d.CODESYSTEM_ID = 9
8 | where
9 | typeId = '116680003' and r.active='1'
10 | and not exists (select 1 from ConceptParentChildLink as pcl where
11 | pcl.relationshipId = r.id and pcl.relationshipId is not null);
12 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.12__ClearDownTempTables.sql:
--------------------------------------------------------------------------------
1 | truncate table tempSimple;
2 |
3 | truncate table tempDescription;
4 |
5 | truncate table tempConcept;
6 |
7 | truncate table tempRelationship;
8 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.13__Indexing.sql:
--------------------------------------------------------------------------------
1 | CREATE EXTENSION IF NOT EXISTS pg_trgm;
2 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.14__Indexing.sql:
--------------------------------------------------------------------------------
1 |
2 | CREATE INDEX CONCURRENTLY IF NOT EXISTS address_postcode_idx ON Address USING gist (postcode gist_trgm_ops);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.15__MedConcepts.sql:
--------------------------------------------------------------------------------
1 |
2 | update Concept set DISPLAY = 'Puff' where CODE = '415215001' AND CODESYSTEM_ID=9;
3 | update Concept set DISPLAY = 'Oral administration of treatment' where CODE = '394899003' AND CODESYSTEM_ID=9;
4 | update Concept set DISPLAY = 'Four times daily as required' where CODE = '1871000175100' AND CODESYSTEM_ID=9;
5 |
6 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.2__LoadFiles.sql:
--------------------------------------------------------------------------------
1 | truncate table tempSimple;
2 |
3 | truncate table tempDescription;
4 |
5 | truncate table tempConcept;
6 |
7 | truncate table tempRelationship;
8 |
9 | --COPY tempConcept FROM '/mysql_exp/tempConcept.txt';
10 |
11 | --COPY tempDescription FROM '/mysql_exp/tempDescription.txt';
12 |
13 | --COPY tempSimple FROM '/mysql_exp/tempSimple.txt';
14 |
15 | --COPY tempRelationship FROM '/mysql_exp/tempRelationship.txt';
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.3__PopulateConceptTable.sql:
--------------------------------------------------------------------------------
1 | insert into Concept (CODE, CODESYSTEM_ID, active)
2 | SELECT
3 | distinct tc.id, 9, true
4 | FROM
5 | tempConcept as tc
6 | where tc.active = '1' and not exists (select 1 from Concept as c where c.CODE=tc.id and CODESYSTEM_ID=9);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.4__PopulateConceptDesignation.sql:
--------------------------------------------------------------------------------
1 | update
2 | tempDescription AS d
3 | set CONCEPT_ID = null;
4 |
5 | update
6 | tempDescription AS d
7 | set CONCEPT_ID = c.CONCEPT_ID
8 | FROM Concept AS c WHERE d.conceptId = c.CODE
9 | AND c.CODESYSTEM_ID = 9 ;
10 |
11 |
12 | update
13 | tempDescription as d
14 | set CONCEPT_DESIGNATION_ID = c.CONCEPT_DESIGNATION_ID
15 | FROM ConceptDesignation c WHERE d.id = c.designationId;
16 |
17 | insert into ConceptDesignation(designationId,term,CONCEPT_ID,designationUse,active)
18 | SELECT
19 | distinct d.id,d.term,d.CONCEPT_ID,
20 | case d.typeId
21 | when '900000000000003001' then 0
22 | when '900000000000013009' then 1
23 | when '900000000000550004' then 2
24 | end
25 | ,true
26 | FROM
27 | tempDescription d
28 | where d.active = '1' and CONCEPT_DESIGNATION_ID is null;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.5__UpdateDisplayTerm.sql:
--------------------------------------------------------------------------------
1 | update Concept as c
2 | set DISPLAY = d.term
3 | from ConceptDesignation as d where c.CONCEPT_ID = d.CONCEPT_ID
4 | and designationUse=0;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.6__PopulateRelationShip.sql:
--------------------------------------------------------------------------------
1 | -- isA only
2 |
3 | insert into ConceptParentChildLink(relationshipId,REL_TYPE,CHILD_CONCEPT_ID,PARENT_CONCEPT_ID,CODESYSTEM_ID)
4 | select r.id,0,s.CONCEPT_ID,d.CONCEPT_ID, 9
5 | from tempRelationship r
6 | join Concept s on r.sourceId = s.CODE and s.CODESYSTEM_ID = 9
7 | join Concept d on r.destinationId = d.CODE and d.CODESYSTEM_ID = 9
8 | where
9 | typeId = '116680003' and r.active='1'
10 | and not exists (select 1 from ConceptParentChildLink as pcl where
11 | pcl.relationshipId = r.id and pcl.relationshipId is not null);
12 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.7__LoadFilesDMD.sql:
--------------------------------------------------------------------------------
1 | truncate table tempSimple;
2 |
3 | truncate table tempDescription;
4 |
5 | truncate table tempConcept;
6 |
7 | truncate table tempRelationship;
8 |
9 | --COPY tempConcept FROM '/mysql_exp/DMD/tempConcept.txt';
10 |
11 | --COPY tempDescription FROM '/mysql_exp/DMD/tempDescription.txt';
12 |
13 | --COPY tempSimple FROM '/mysql_exp/DMD/tempSimple.txt';
14 |
15 | --COPY tempRelationship FROM '/mysql_exp/DMD/tempRelationship.txt';
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.8__PopulateConceptTable.sql:
--------------------------------------------------------------------------------
1 | insert into Concept (CODE, CODESYSTEM_ID, active)
2 | SELECT
3 | distinct tc.id, 9, true
4 | FROM
5 | tempConcept as tc
6 | where tc.active = '1' and not exists (select 1 from Concept as c where c.CODE=tc.id and CODESYSTEM_ID=9);
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V5.9__PopulateConceptDesignation.sql:
--------------------------------------------------------------------------------
1 | update
2 | tempDescription AS d
3 | set CONCEPT_ID = null;
4 |
5 | update
6 | tempDescription AS d
7 | set CONCEPT_ID = c.CONCEPT_ID
8 | FROM Concept AS c WHERE d.conceptId = c.CODE
9 | AND c.CODESYSTEM_ID = 9 ;
10 |
11 |
12 | update
13 | tempDescription as d
14 | set CONCEPT_DESIGNATION_ID = c.CONCEPT_DESIGNATION_ID
15 | FROM ConceptDesignation c WHERE d.id = c.designationId;
16 |
17 | insert into ConceptDesignation(designationId,term,CONCEPT_ID,designationUse,active)
18 | SELECT
19 | distinct d.id,d.term,d.CONCEPT_ID,
20 | case d.typeId
21 | when '900000000000003001' then 0
22 | when '900000000000013009' then 1
23 | when '900000000000550004' then 2
24 | end
25 | ,true
26 | FROM
27 | tempDescription d
28 | where d.active = '1' and CONCEPT_DESIGNATION_ID is null;
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V6.1__PostgreSQL Sequence Fix2.sql:
--------------------------------------------------------------------------------
1 |
2 | -- EpisodeOfCare
3 |
4 |
5 | SELECT setval('episodeofcare_episode_id_seq', COALESCE((SELECT MAX(episode_id)+1 FROM episodeofcare), 1), false)
6 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
7 |
8 |
9 | SELECT setval('episodeofcareidentifier_episode_identifier_id_seq', COALESCE((SELECT MAX(episode_identifier_id)+1 FROM episodeofcareidentifier), 1), false)
10 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
11 |
12 |
13 | SELECT setval('episodeofcarediagnosis_episode_diagnosis_id_seq', COALESCE((SELECT MAX(episode_diagnosis_id)+1 FROM episodeofcarediagnosis), 1), false)
14 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
15 |
16 |
17 | SELECT setval('episodeofcarereferral_episode_referral_id_seq', COALESCE((SELECT MAX(episode_referral_id)+1 FROM episodeofcarereferral), 1), false)
18 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
19 |
20 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V6.2__PostgreSQL Sequence Fix3.sql:
--------------------------------------------------------------------------------
1 |
2 | -- ValueSet
3 |
4 |
5 |
6 | SELECT setval('valueset_valueset_id_seq', COALESCE((SELECT MAX(valueset_id)+1 FROM valueset), 1), false)
7 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
8 |
9 | SELECT setval('valuesetinclude_valueset_include_id_seq', COALESCE((SELECT MAX(valueset_include_id)+1 FROM valuesetinclude), 1), false)
10 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
11 |
12 | SELECT setval('valuesetincludefilter_valueset_include_filter_id_seq', COALESCE((SELECT MAX(valueset_include_filter_id)+1 FROM valuesetincludefilter), 1), false)
13 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
14 |
15 | SELECT setval('valuesetincludeconcept_valueset_include_concept_id_seq', COALESCE((SELECT MAX(valueset_include_concept_id)+1 FROM valuesetincludeconcept), 1), false)
16 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
17 |
18 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V6.3__PostgreSQL Sequence Fix4.sql:
--------------------------------------------------------------------------------
1 |
2 | -- Concept Map
3 |
4 | SELECT setval('conceptmap_concept_map_id_seq', COALESCE((SELECT MAX(concept_map_id)+1 FROM conceptmap), 1), false)
5 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
6 |
7 | SELECT setval('conceptmapelement_concept_map_element_id_seq', COALESCE((SELECT MAX(concept_map_element_id)+1 FROM conceptmapelement), 1), false)
8 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
9 |
10 | SELECT setval('conceptmapgroup_concept_map_group_id_seq', COALESCE((SELECT MAX(concept_map_group_id)+1 FROM conceptmapgroup), 1), false)
11 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
12 |
13 | SELECT setval('conceptmapidentifier_concept_map_identifier_id_seq', COALESCE((SELECT MAX(concept_map_identifier_id)+1 FROM conceptmapidentifier), 1), false)
14 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
15 |
16 | SELECT setval('conceptmaptarget_concept_map_target_id_seq', COALESCE((SELECT MAX(concept_map_target_id)+1 FROM conceptmaptarget), 1), false)
17 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
18 |
19 | SELECT setval('conceptmaptelecom_concept_map_telecom_id_seq', COALESCE((SELECT MAX(concept_map_telecom_id)+1 FROM conceptmaptelecom), 1), false)
20 | WHERE EXISTS (SELECT 1 FROM pg_class c WHERE c.relkind = 'S');
21 |
--------------------------------------------------------------------------------
/ccri-database/src/main/resources/db/postgreSQL/V6.4__RefreshStoredResource.sql:
--------------------------------------------------------------------------------
1 |
2 | update observation set resource = null;
3 |
4 | update patient set resource = null;
5 |
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | logging.level.org.springframework.web=INFO
2 | logging.level.org.hibernate=INFO
3 | datasource.cleardown.cron=0 19 21 * * *
4 | datasource.showSql=false
5 | datasource.showDdl=false
6 | datasource.vendor=h2
7 | datasource.path=db1;MODE=PostgreSQL
8 | datasource.host=mem
9 | datasource.driver:org.h2.Driver
10 | datasource.dialect=org.hibernate.dialect.H2Dialect
11 | datasource.username=fhirjpa
12 | datasource.password=fhirjpa
13 | flyway.locations=db/common
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/cucumber.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/loinc/LOINC_2.54_MULTI-AXIAL_HIERARCHY.CSV:
--------------------------------------------------------------------------------
1 | PATH_TO_ROOT,SEQUENCE,IMMEDIATE_PARENT,CODE,CODE_TEXT
2 | ,1,,LP31755-9,Microbiology
3 | LP31755-9,1,LP31755-9,LP14559-6,Microorganism
4 | LP31755-9.LP14559-6,1,LP14559-6,LP98185-9,Bacteria
5 | LP31755-9.LP14559-6.LP98185-9,1,LP98185-9,LP14082-9,Bacteria
6 | LP31755-9.LP14559-6.LP98185-9.LP14082-9,1,LP14082-9,LP52258-8,Bacteria | Body Fluid
7 | LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52258-8,1,LP52258-8,41599-2,Bacteria Fld Ql Micro
8 | LP31755-9.LP14559-6.LP98185-9.LP14082-9,2,LP14082-9,LP52260-4,Bacteria | Cerebral spinal fluid
9 | LP31755-9.LP14559-6.LP98185-9.LP14082-9.LP52260-4,1,LP52260-4,41602-4,Bacteria CSF Ql Micro
10 | LP31755-9.LP14559-6.LP98185-9.LP14082-9,3,LP14082-9,LP52960-9,Bacteria | Cervix
11 |
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/sct/sct2_Concept_Full-en_INT_20160131.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nhsconnect/careconnect-reference-implementation/6965c161c8df185b7fa785b4282fdf01166dbaa7/ccri-database/src/test/resources/sct/sct2_Concept_Full-en_INT_20160131.txt
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/sct/sct2_Concept_Full_INT_20160131.txt:
--------------------------------------------------------------------------------
1 | id effectiveTime active moduleId definitionStatusId
2 | 100005 20020131 0 900000000000207008 900000000000074008
3 | 101009 20020131 1 900000000000207008 900000000000074008
4 | 102002 20020131 1 900000000000207008 900000000000074008
5 | 103007 20020131 1 900000000000207008 900000000000074008
6 | 104001 20020131 1 900000000000207008 900000000000073002
7 | 105000 20020131 1 900000000000207008 900000000000074008
8 | 105000 20040731 0 900000000000207008 900000000000074008
9 | 106004 20020131 1 900000000000207008 900000000000074008
10 | 107008 20020131 1 900000000000207008 900000000000074008
11 | 116680003 20020131 1 900000000000207008 900000000000074008
12 | 126815003 20020131 1 900000000000207008 900000000000074008
13 | 126813005 20020131 1 900000000000207008 900000000000074008
14 | 126813006 20020131 1 900000000000207008 900000000000074008
15 | 126817006 20020131 1 900000000000207008 900000000000074008
16 | 126816002 20020131 1 900000000000207008 900000000000074008
17 | 207527008 20020131 1 900000000000207008 900000000000074008
18 | 207527008 20040731 1 900000000000207008 900000000000073002
19 | 207527008 20090731 0 900000000000207008 900000000000074008
20 | 404684003 20040131 1 900000000000207008 900000000000074008
21 |
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/sct/sct2_Identifier_Full_INT_20160131.txt:
--------------------------------------------------------------------------------
1 | identifierSchemeId alternateIdentifier effectiveTime active moduleId referencedComponentId
2 |
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/sct/sct2_Relationship_Full_INT_20160131.txt:
--------------------------------------------------------------------------------
1 | id effectiveTime active moduleId sourceId destinationId relationshipGroup typeId characteristicTypeId modifierId
2 | 100022 20020131 1 900000000000207008 126815003 126813005 0 116680003 900000000000011006 900000000000451002
3 | 100025 20020131 1 900000000000207008 126816002 126813005 0 116680003 900000000000011006 900000000000451002
4 | 100025 20090731 0 900000000000207008 126816002 126813005 0 116680003 900000000000011006 900000000000451002
5 | 101021 20020131 1 900000000000207008 126817006 126815003 0 116680003 900000000000011006 900000000000451002
6 | 101021 20020131 1 900000000000207008 126815003 126817006 0 116680003 900000000000011006 900000000000451002
7 |
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/sct/sct2_StatedRelationship_Full_INT_20160131.txt:
--------------------------------------------------------------------------------
1 | id effectiveTime active moduleId sourceId destinationId relationshipGroup typeId characteristicTypeId modifierId
2 | 3187444026 20140131 1 900000000000207008 425630003 400195000 0 42752001 900000000000010007 900000000000451002
3 | 3187444026 20160131 0 900000000000207008 425630003 400195000 0 42752001 900000000000010007 900000000000451002
4 | 3192499027 20140131 0 900000000000207008 425630003 105590001 0 246075003 900000000000010007 900000000000451002
5 | 3574321020 20140131 1 900000000000207008 425630003 111189002 0 116680003 900000000000010007 900000000000451002
6 | 3574321020 20160131 0 900000000000207008 425630003 111189002 0 116680003 900000000000010007 900000000000451002
7 | 3829433029 20080731 1 900000000000207008 102977005 102976001 0 116680003 900000000000010007 900000000000451002
8 | 3829434024 20080731 1 900000000000207008 413337008 306751006 0 116680003 900000000000010007 900000000000451002
9 | 3829435020 20080731 1 900000000000207008 103085008 72909000 0 116680003 900000000000010007 900000000000451002
10 | 3829436021 20080731 1 900000000000207008 103085008 259648002 0 116680003 900000000000010007 900000000000451002
11 |
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/sct/sct2_TextDefinition_Full-en_INT_20160131.txt:
--------------------------------------------------------------------------------
1 | id effectiveTime active moduleId conceptId languageCode typeId term caseSignificanceId
2 | 2884452019 20040731 1 900000000000207008 410016009 en 900000000000550004 A decrease in lower leg circumference due to recurrent ulceration and fat necrosis causing loss of subcutaneous tissue in a patient with venous stasis disease 900000000000017005
3 | 2884453012 20050731 1 900000000000207008 416118004 en 900000000000550004 Introduction of a substance to the body 900000000000017005
4 | 2884454018 20030731 1 900000000000207008 125097000 en 900000000000550004 Domestic goat 900000000000017005
5 | 2884455017 20030731 1 900000000000207008 125099002 en 900000000000550004 Domestic sheep species 900000000000017005
6 | 2884455017 20110131 0 900000000000207008 125099002 en 900000000000550004 Domestic sheep species 900000000000017005
7 | 2884456016 20030731 1 900000000000207008 122868007 en 900000000000550004 An implantation of a staple 900000000000017005
8 | 2884457013 20030731 1 900000000000207008 125085001 en 900000000000550004 Equus subspecies 900000000000017005
9 | 2884457013 20100731 0 900000000000207008 125085001 en 900000000000550004 Equus subspecies 900000000000017005
10 | 2884458015 20030731 1 900000000000207008 125671007 en 900000000000550004 Disruption of continuity of tissue, not necessarily due to external forces; may be due to weakness in the tissue or excessive internal pressures 900000000000017005
11 |
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/xml/Location.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ccri-database/src/test/resources/xml/Practitioner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/ccri-fhirserver/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | encoding//src/main/java=UTF-8
3 | encoding//src/main/resources=UTF-8
4 | encoding//src/test/resources=UTF-8
5 | encoding/=UTF-8
6 |
--------------------------------------------------------------------------------
/ccri-fhirserver/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | eclipse.preferences.version=1
2 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
3 | org.eclipse.jdt.core.compiler.compliance=1.8
4 | org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
5 | org.eclipse.jdt.core.compiler.source=1.8
6 |
--------------------------------------------------------------------------------
/ccri-fhirserver/.settings/org.eclipse.m2e.core.prefs:
--------------------------------------------------------------------------------
1 | activeProfiles=
2 | eclipse.preferences.version=1
3 | resolveWorkspaceProjects=true
4 | version=1
5 |
--------------------------------------------------------------------------------
/ccri-fhirserver/.settings/org.eclipse.wst.common.project.facet.core.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ccri-fhirserver/.settings/org.hibernate.eclipse.console.prefs:
--------------------------------------------------------------------------------
1 | default.configuration=ccri-fhirserver
2 | eclipse.preferences.version=1
3 | hibernate3.enabled=true
4 |
--------------------------------------------------------------------------------
/ccri-fhirserver/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM openjdk:11-slim
2 | VOLUME /tmp
3 |
4 | ENV JAVA_OPTS="-Xms128m -Xmx512m"
5 |
6 |
7 | ADD target/ccri-fhirserver.jar ccri-fhirserver.jar
8 |
9 |
10 | ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/ccri-fhirserver.jar"]
11 |
12 |
13 |
--------------------------------------------------------------------------------
/ccri-fhirserver/readme.md:
--------------------------------------------------------------------------------
1 | In this directory
2 |
3 | mvn install
4 |
5 | docker build . -t ccri-fhirserver
6 |
7 | docker tag ccri-fhirserver thorlogic/ccri-fhirserver
8 |
9 | docker push thorlogic/ccri-fhirserver
10 |
11 |
12 | docker run -d -p 8186:8186 ccri-ccri-fhirserver
13 |
14 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/main/java/uk/nhs/careconnect/ccri/fhirserver/apidocs/ServiceDefinitionsContext.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ccri.fhirserver.apidocs;
2 |
3 | import org.springframework.stereotype.Component;
4 | import springfox.documentation.swagger.web.SwaggerResource;
5 | import uk.nhs.careconnect.ccri.fhirserver.HapiProperties;
6 |
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | @Component
11 | public class ServiceDefinitionsContext {
12 |
13 |
14 | public List getSwaggerDefinitions() {
15 |
16 | List resources = new ArrayList<>();
17 | SwaggerResource resource = new SwaggerResource();
18 | resource.setLocation("/apidocs" );
19 | resource.setName(HapiProperties.getServerName());
20 | resource.setSwaggerVersion("2.0");
21 | resources.add(resource);
22 | return resources;
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/main/java/uk/nhs/careconnect/ccri/fhirserver/apidocs/SwaggerUIConfig.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ccri.fhirserver.apidocs;
2 |
3 | import org.springframework.context.annotation.Bean;
4 | import org.springframework.context.annotation.Configuration;
5 | import org.springframework.context.annotation.Lazy;
6 | import org.springframework.context.annotation.Primary;
7 | import springfox.documentation.swagger.web.SwaggerResource;
8 | import springfox.documentation.swagger.web.SwaggerResourcesProvider;
9 |
10 | import java.util.ArrayList;
11 | import java.util.List;
12 |
13 | @Configuration
14 | public class SwaggerUIConfig {
15 |
16 | @Primary
17 | @Bean
18 | @Lazy
19 | public SwaggerResourcesProvider swaggerResourcesProvider(ServiceDefinitionsContext definitionContext ) {
20 |
21 | return () -> {
22 | List resources = new ArrayList<>();
23 | resources.clear();
24 | resources.addAll(definitionContext.getSwaggerDefinitions());
25 | return resources;
26 | };
27 | }
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/main/java/uk/nhs/careconnect/ccri/fhirserver/configuration/LoggingConfig.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ccri.fhirserver.configuration;
2 |
3 | //import io.hawt.log.log4j.Log4jLogQuery;
4 | import org.springframework.context.annotation.Configuration;
5 |
6 |
7 | @Configuration
8 | public class LoggingConfig {
9 | // See config details from http://hawt.io/plugins/logs/
10 |
11 |
12 | /* @Bean(name = "LogQuery", destroyMethod = "stop", initMethod = "start")
13 | @Scope("singleton")
14 | @Lazy(false)
15 | public Log4jLogQuery log4jLogQuery() {
16 | Log4jLogQuery log4jLogQuery = new Log4jLogQuery();
17 | return log4jLogQuery;
18 | }
19 | */
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/main/java/uk/nhs/careconnect/ccri/fhirserver/stu3/provider/ICCResourceProvider.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ccri.fhirserver.stu3.provider;
2 |
3 | import ca.uhn.fhir.rest.server.IResourceProvider;
4 |
5 | public interface ICCResourceProvider extends IResourceProvider {
6 |
7 | Long count();
8 | }
9 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/main/java/uk/nhs/careconnect/ccri/fhirserver/stu3/provider/ValidationSupportProvider.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ccri.fhirserver.stu3.provider;
2 |
3 | import ca.uhn.fhir.context.FhirContext;
4 | import ca.uhn.fhir.parser.IParser;
5 | import ca.uhn.fhir.rest.client.api.IGenericClient;
6 | import org.hl7.fhir.dstu3.model.ValueSet.ConceptSetComponent;
7 | import org.hl7.fhir.dstu3.model.ValueSet.ValueSetExpansionComponent;
8 | import org.springframework.beans.factory.annotation.Autowired;
9 | import org.springframework.stereotype.Component;
10 |
11 | @Component
12 | public class ValidationSupportProvider {
13 |
14 | // KGM 21st May 2018 Incorporated Tim Coates code to use UK FHIR Reference Servers.
15 |
16 |
17 | @Autowired
18 | private FhirContext ctx = null;
19 |
20 | IGenericClient client;
21 |
22 | private IParser parser;
23 | /**
24 | * Milliseconds we'll wait to read data over http.
25 | */
26 | ValidationSupportProvider(FhirContext xstu3) {
27 |
28 | }
29 |
30 | public ValueSetExpansionComponent expandValueSet(ConceptSetComponent theInclude) {
31 |
32 | ValueSetExpansionComponent retVal = new ValueSetExpansionComponent();
33 |
34 |
35 | return retVal;
36 | }
37 |
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/main/java/uk/nhs/careconnect/ccri/fhirserver/support/FhirMediaType.java:
--------------------------------------------------------------------------------
1 | package uk.nhs.careconnect.ccri.fhirserver.support;
2 |
3 | public final class FhirMediaType {
4 |
5 | private FhirMediaType() { }
6 |
7 | public static final String APPLICATION_FHIR_JSON_VALUE = "application/fhir+json";
8 |
9 | public static final String APPLICATION_FHIR_XML_VALUE = "application/fhir+xml";
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/main/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/main/resources/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/test/resources/.keep_hapi-fhir-jpaserver-example:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/nhsconnect/careconnect-reference-implementation/6965c161c8df185b7fa785b4282fdf01166dbaa7/ccri-fhirserver/src/test/resources/.keep_hapi-fhir-jpaserver-example
--------------------------------------------------------------------------------
/ccri-fhirserver/src/test/resources/application.properties:
--------------------------------------------------------------------------------
1 | datasource.cleardown.cron=0 19 21 * * *
2 | datasource.showSql=false
3 | datasource.showDdl=false
4 | datasource.vendor=h2
5 | datasource.path=db1;MODE=PostgreSQL
6 | datasource.host=mem
7 | datasource.driver:org.h2.Driver
8 | datasource.dialect=org.hibernate.dialect.H2Dialect
9 | datasource.username=fhirjpa
10 | datasource.password=fhirjpa
11 | conf.implementation.description=Care Connect Reference Implementation
12 | conf.software.version=3.1
13 | conf.software.name=CCRI-Server
--------------------------------------------------------------------------------
/ccri-fhirserver/src/test/resources/cucumber/FHIRServerApiConditionTest.feature:
--------------------------------------------------------------------------------
1 | Feature: Phase 1 Exemplar Test
2 | As a client FHIR application
3 | I want to search for Patients
4 |
5 |
6 |
7 |
8 | Scenario: Condition Search by greater than date
9 | Given Condition Search by gt2017-10-18
10 | Then the result should be a valid FHIR Bundle
11 | And the results should be valid CareConnect Profiles
12 |
13 | Scenario: Condition Search by greater equal date
14 | Given Condition Search by ge2017-10-18
15 | Then the result should be a valid FHIR Bundle
16 | And the results should be valid CareConnect Profiles
17 |
18 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/test/resources/cucumber/FHIRServerApiTest.feature:
--------------------------------------------------------------------------------
1 | Feature: Phase 1 Exemplar Test
2 | As a client FHIR application
3 | I want to search for Patients
4 |
5 |
6 | Scenario: Patient Search by familyName
7 | Given Patient Search by familyName kanfeld
8 | Then the result should be a valid FHIR Bundle
9 | And the results should be valid CareConnect Profiles
10 |
11 | Scenario: Organisation Search by name
12 | Given Organisation Search by name moir
13 | Then the result should be a valid FHIR Bundle
14 | And the results should be valid CareConnect Profiles
15 |
16 | Scenario: Practitioner Search by name
17 | Given Practitioner Search by name Bhatia
18 | Then the result should be a valid FHIR Bundle
19 | And the results should be valid CareConnect Profiles
20 |
21 | Scenario: Location Search by name
22 | Given Location Search by name Long
23 | Then the result should be a valid FHIR Bundle
24 | And the results should be valid CareConnect Profiles
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/test/resources/cucumber/ServerPractitionerRoleTest.feature:
--------------------------------------------------------------------------------
1 | Feature: Observation Integration Test
2 | As a client FHIR system
3 |
4 |
5 | Scenario: PractitionerRole Post
6 | Given PractitionerRole resource file
7 | Then save the PractitionerRole
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/test/resources/log4j2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ccri-fhirserver/src/test/resources/xml/PractitionerRole.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/docker-compose.devnetoverride.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 |
3 | services:
4 |
5 | ccrisql:
6 | ports:
7 | - 43306:3306
8 | volumes:
9 | - /docker-data/ccri-mysql:/var/lib/mysql
10 |
11 | ccrifhir:
12 | volumes:
13 | - /docker-data/ccri-gateway-logs:/usr/local/tomcat/logs
14 |
15 | ccrismartonfhir:
16 | volumes:
17 | - /docker-data/ccri-gatewayssl-logs:/usr/local/tomcat/logs
18 |
19 | ccridocument2:
20 | volumes:
21 | - /docker-data/ccri-document-logs:/usr/local/tomcat/logs
22 |
23 | ccrimessaging:
24 | volumes:
25 | - /docker-data/ccri-integration-logs:/usr/local/tomcat/logs
--------------------------------------------------------------------------------
/docker-compose.devnetoverridetest.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 |
3 | services:
4 |
5 | ccrisql:
6 | ports:
7 | - 43306:3306
8 | volumes:
9 | - /docker-data/ccri-mysql:/var/lib/mysql
10 |
11 | ccrifhir:
12 | volumes:
13 | - /docker-data/ccri-gateway-logs:/usr/local/tomcat/logs
14 |
15 | ccridocument2:
16 | volumes:
17 | - /docker-data/ccri-document-logs:/usr/local/tomcat/logs
18 |
19 | ccrimessaging:
20 | volumes:
21 | - /docker-data/ccri-integration-logs:/usr/local/tomcat/logs
--------------------------------------------------------------------------------
/docker-compose.validation.yml:
--------------------------------------------------------------------------------
1 | version: '2'
2 | services:
3 |
4 | tkwvalidation:
5 | container_name: tkwvalidation
6 | image: damianmurphy/fhir_production_validator:20190301
7 | ports:
8 | - 4849:4849
9 | volumes:
10 | - /docker:/home/service/data
11 |
12 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | docker-compose -f docker-compose.validation.yml pull
2 | docker-compose -f docker-compose.validation.yml up -d
3 |
--------------------------------------------------------------------------------
/startServer.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | docker-compose up -d
--------------------------------------------------------------------------------
/startServerWithElk.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | docker-compose -f docker-compose.yml -f docker-compose-elk.yml up -d
--------------------------------------------------------------------------------
/stopServer.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | docker-compose -f docker-compose.yml -f docker-compose-elk.yml stop
--------------------------------------------------------------------------------