diff --git a/.deployments/k8-argo-run-ris.yaml b/.deployments/k8-argo-run-ris.yaml index ac9920e..3a1c144 100644 --- a/.deployments/k8-argo-run-ris.yaml +++ b/.deployments/k8-argo-run-ris.yaml @@ -1,3 +1,74 @@ +# This file is a k8s deployment file for the Reference Implementations of the Argonaut Project +# The first section is the ingress for all RIs +kind: Ingress +apiVersion: networking.k8s.io/v1 +metadata: + name: subscriptions-ingress + namespace: subscriptions-ri + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod +spec: + tls: + - hosts: + - subscriptions.argo.run + - cdex.ri.argo.run + - ecr.ri.argo.run + - vitals-server.ri.argo.run + - feature-cs-server.ri.argo.run + secretName: tls-secret + rules: + - host: subscriptions.argo.run + http: + paths: + - backend: + service: + name: ri-subscriptions + port: + number: 80 + path: / + pathType: Prefix + - host: cdex.ri.argo.run + http: + paths: + - backend: + service: + name: ri-cdex + port: + number: 80 + path: / + pathType: Prefix + - host: ecr.ri.argo.run + http: + paths: + - backend: + service: + name: ri-ecr + port: + number: 80 + path: / + pathType: Prefix + - host: vitals-server.ri.argo.run + http: + paths: + - backend: + service: + name: ri-vitals-server + port: + number: 80 + path: / + pathType: Prefix + - host: feature-cs-server.ri.argo.run + http: + paths: + - backend: + service: + name: ri-feature-cs-server + port: + number: 80 + path: / + pathType: Prefix +--- +# subscriptions.argo.run Deployment apiVersion: apps/v1 kind: Deployment metadata: @@ -18,6 +89,11 @@ spec: containers: - name: fhir-candle image: ghcr.io/fhir/fhir-candle:latest + resources: + limits: + memory: "512Mi" + requests: + memory: "128Mi" command: ["dotnet"] args: ["fhir-candle.dll", "--reference-implementation", "subscriptions", "--load-package", "hl7.fhir.uv.subscriptions-backport#1.1.0", "--load-examples", "false", "--protect-source", "true", "-m", "200"] envFrom: @@ -63,6 +139,7 @@ spec: ports: - containerPort: 5826 --- +# subscriptions.argo.run Service apiVersion: v1 kind: Service metadata: @@ -76,70 +153,345 @@ spec: port: 80 targetPort: 5826 --- -kind: Ingress -apiVersion: networking.k8s.io/v1 +# cdex.ri.argo.run Deployment +apiVersion: apps/v1 +kind: Deployment metadata: - name: subscriptions-ingress + name: ri-cdex namespace: subscriptions-ri - annotations: - cert-manager.io/cluster-issuer: letsencrypt-prod + labels: + app: ri-cdex spec: - tls: - - hosts: - - subscriptions.argo.run - - cdex.ri.argo.run - - ecr.ri.argo.run - - vitals-server.ri.argo.run - - feature-cs-server.ri.argo.run - secretName: tls-secret - rules: - - host: subscriptions.argo.run - http: - paths: - - backend: - service: - name: ri-subscriptions - port: - number: 80 - path: / - pathType: Prefix - - host: cdex.ri.argo.run - http: - paths: - - backend: - service: - name: ri-cdex - port: - number: 80 - path: / - pathType: Prefix - - host: ecr.ri.argo.run - http: - paths: - - backend: - service: - name: ri-ecr - port: - number: 80 - path: / - pathType: Prefix - - host: vitals-server.ri.argo.run - http: - paths: - - backend: - service: - name: ri-vitals-server - port: - number: 80 - path: / - pathType: Prefix - - host: feature-cs-server.ri.argo.run - http: - paths: - - backend: - service: - name: ri-feature-cs-server - port: - number: 80 - path: / - pathType: Prefix + replicas: 1 + selector: + matchLabels: + app: ri-cdex + template: + metadata: + labels: + app: ri-cdex + spec: + containers: + - name: fhir-candle + image: ghcr.io/fhir/fhir-candle:latest + resources: + limits: + memory: "512Mi" + requests: + memory: "128Mi" + command: ["dotnet"] + args: ["fhir-candle.dll", "--reference-implementation", "hl7.fhir.us.davinci-cdex", "--ci-package", "HL7/davinci-pas", "--load-package", "hl7.fhir.us.davinci-cdex#2.0.0", "--r4", "provider", "--r4", "payer", "--protect-source", "true", "-m", "400", "--max-subscription-minutes", "1440"] + envFrom: + - configMapRef: + name: special-config + env: + - name: Listen_Port + value: "5826" + - name: Public_Url + value: "https://subscriptions.argo.run" + - name: Zulip_Email + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: Zulip_Email + - name: Zulip_Key + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: Zulip_Key + - name: Zulip_Url + value: "https://chat.fhir.org" + - name: SMTP_Host + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Host + - name: SMTP_Password + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Password + - name: SMTP_Port + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Port + - name: SMTP_User + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_User + ports: + - containerPort: 5826 +--- +# cdex.ri.argo.run Service +apiVersion: v1 +kind: Service +metadata: + namespace: subscriptions-ri + name: ri-cdex +spec: + selector: + app: ri-cdex + ports: + - protocol: TCP + port: 80 + targetPort: 5826 + +--- +# ecr.ri.argo.run Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ri-ecr + namespace: subscriptions-ri + labels: + app: ri-ecr +spec: + replicas: 1 + selector: + matchLabels: + app: ri-ecr + template: + metadata: + labels: + app: ri-ecr + spec: + containers: + - name: fhir-candle + image: ghcr.io/fhir/fhir-candle:latest + resources: + limits: + memory: "512Mi" + requests: + memory: "128Mi" + command: ["dotnet"] + args: ["fhir-candle.dll", "--reference-implementation", "hl7.fhir.us.ecr", "--load-package", "hl7.fhir.us.ecr", "--r4", "r4", "--smart-optional", "r4", "--protect-source", "true", "-m", "1000", "--max-subscription-minutes", "240", "--load-examples", "true"] + envFrom: + - configMapRef: + name: special-config + env: + - name: Listen_Port + value: "5826" + - name: Public_Url + value: "https://subscriptions.argo.run" + - name: Zulip_Email + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: Zulip_Email + - name: Zulip_Key + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: Zulip_Key + - name: Zulip_Url + value: "https://chat.fhir.org" + - name: SMTP_Host + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Host + - name: SMTP_Password + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Password + - name: SMTP_Port + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Port + - name: SMTP_User + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_User + ports: + - containerPort: 5826 +--- +# ecr.ri.argo.run Service +apiVersion: v1 +kind: Service +metadata: + namespace: subscriptions-ri + name: ri-ecr +spec: + selector: + app: ri-ecr + ports: + - protocol: TCP + port: 80 + targetPort: 5826 + +--- +# vitals-server.ri.argo.run Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ri-vitals-server + namespace: subscriptions-ri + labels: + app: ri-vitals-server +spec: + replicas: 1 + selector: + matchLabels: + app: ri-vitals-server + template: + metadata: + labels: + app: ri-vitals-server + spec: + containers: + - name: fhir-candle + image: ghcr.io/fhir/fhir-candle:latest + resources: + limits: + memory: "512Mi" + requests: + memory: "128Mi" + command: ["dotnet"] + args: ["fhir-candle.dll", "--reference-implementation", "smart", "--r4", "open", "--r4", "smart", "--smart-required", "smart", "--protect-source", "true", "-m", "500"] + envFrom: + - configMapRef: + name: special-config + env: + - name: Listen_Port + value: "5826" + - name: Public_Url + value: "https://subscriptions.argo.run" + - name: Zulip_Email + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: Zulip_Email + - name: Zulip_Key + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: Zulip_Key + - name: Zulip_Url + value: "https://chat.fhir.org" + - name: SMTP_Host + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Host + - name: SMTP_Password + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Password + - name: SMTP_Port + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Port + - name: SMTP_User + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_User + ports: + - containerPort: 5826 +--- +# vitals-server.ri.argo.run Service +apiVersion: v1 +kind: Service +metadata: + namespace: subscriptions-ri + name: ri-vitals-server +spec: + selector: + app: ri-vitals-server + ports: + - protocol: TCP + port: 80 + targetPort: 5826 + +--- +# feature-cs-server.ri.argo.run Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: ri-feature-cs-server + namespace: subscriptions-ri + labels: + app: ri-feature-cs-server +spec: + replicas: 1 + selector: + matchLabels: + app: ri-feature-cs-server + template: + metadata: + labels: + app: ri-feature-cs-server + spec: + containers: + - name: fhir-candle + image: ghcr.io/fhir/fhir-candle:latest + resources: + limits: + memory: "512Mi" + requests: + memory: "128Mi" + command: ["dotnet"] + args: ["fhir-candle.dll", "--reference-implementation", "feature-cs", "--r4", "r4", "--smart-optional", "r4", "--protect-source", "true", "-m", "100"] + envFrom: + - configMapRef: + name: special-config + env: + - name: Listen_Port + value: "5826" + - name: Public_Url + value: "https://subscriptions.argo.run" + - name: Zulip_Email + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: Zulip_Email + - name: Zulip_Key + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: Zulip_Key + - name: Zulip_Url + value: "https://chat.fhir.org" + - name: SMTP_Host + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Host + - name: SMTP_Password + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Password + - name: SMTP_Port + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_Port + - name: SMTP_User + valueFrom: + secretKeyRef: + name: argonaut-secrets + key: SMTP_User + ports: + - containerPort: 5826 +--- +# vitals-server.ri.argo.run Service +apiVersion: v1 +kind: Service +metadata: + namespace: subscriptions-ri + name: ri-feature-cs-server +spec: + selector: + app: ri-feature-cs-server + ports: + - protocol: TCP + port: 80 + targetPort: 5826 diff --git a/fhirData/feature-cs/r4/Patient-davinci-amy-shaw.json b/fhirData/feature-cs/r4/Patient-davinci-amy-shaw.json new file mode 100644 index 0000000..f4057d1 --- /dev/null +++ b/fhirData/feature-cs/r4/Patient-davinci-amy-shaw.json @@ -0,0 +1,42 @@ +{ + "resourceType": "Patient", + "id": "davinci-amy-shaw", + "meta": { + "profile": [ + "http://hl7.org/fhir/us/davinci-cdex/StructureDefinition/cdex-patient-demographics" + ], + "tag": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", + "code": "HTEST", + "display": "test health data" + } + ] + }, + "identifier": [ + { + "use": "usual", + "type": { + "coding": [ + { + "system": "http://hl7.org/fhir/us/davinci-hrex/CodeSystem/hrex-temp", + "code": "UMB", + "display": "Member Number" + } + ], + "text": "Member Number" + }, + "system": "http://example.org/cdex/payer/member-ids", + "value": "Member123" + } + ], + "name": [ + { + "family": "Shaw", + "given": [ + "Amy" + ] + } + ], + "birthDate": "1987-02-20" +} \ No newline at end of file diff --git a/fhirData/feature-cs/r4/Patient-davinci-jesse-smith.json b/fhirData/feature-cs/r4/Patient-davinci-jesse-smith.json new file mode 100644 index 0000000..dc2940b --- /dev/null +++ b/fhirData/feature-cs/r4/Patient-davinci-jesse-smith.json @@ -0,0 +1,38 @@ +{ + "resourceType": "Patient", + "id": "davinci-jesse-smith", + "meta": { + "profile": [ + "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-beneficiary" + ], + "tag": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", + "code": "HTEST", + "display": "test health data" + } + ] + }, + "identifier": [ + { + "system": "http://example.org/MIN", + "value": "12345678902" + } + ], + "name": [ + { + "family": "SMITH", + "given": [ + "JESSE" + ] + } + ], + "gender": "female", + "birthDate": "1947-01-18", + "address": [ + { + "country": "US" + } + ], + "multipleBirthInteger": 1 +} \ No newline at end of file diff --git a/fhirData/feature-cs/r4/Patient-davinci-joe-smith.json b/fhirData/feature-cs/r4/Patient-davinci-joe-smith.json new file mode 100644 index 0000000..a640d5b --- /dev/null +++ b/fhirData/feature-cs/r4/Patient-davinci-joe-smith.json @@ -0,0 +1,44 @@ +{ + "resourceType": "Patient", + "id": "davinci-joe-smith", + "meta": { + "profile": [ + "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-subscriber" + ], + "tag": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", + "code": "HTEST", + "display": "test health data" + } + ] + }, + "extension": [ + { + "url": "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/extension-militaryStatus", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://codesystem.x12.org/005010/584", + "code": "RU" + } + ] + } + } + ], + "identifier": [ + { + "system": "http://example.org/MIN", + "value": "12345678901" + } + ], + "name": [ + { + "family": "SMITH", + "given": [ + "JOE" + ] + } + ], + "gender": "male" +} \ No newline at end of file diff --git a/fhirData/feature-cs/r4/Practitioner-davinci-ronald-bone.json b/fhirData/feature-cs/r4/Practitioner-davinci-ronald-bone.json new file mode 100644 index 0000000..a18d5f5 --- /dev/null +++ b/fhirData/feature-cs/r4/Practitioner-davinci-ronald-bone.json @@ -0,0 +1,62 @@ +{ + "resourceType": "Practitioner", + "id": "davinci-ronald-bone", + "meta": { + "profile": [ + "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner" + ], + "tag": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", + "code": "HTEST", + "display": "test health data" + } + ] + }, + "identifier": [ + { + "system": "http://hl7.org/fhir/sid/us-npi", + "value": "9941339100" + }, + { + "extension": [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-jurisdiction", + "valueCodeableConcept": { + "coding": [ + { + "system": "https://www.usps.com/", + "code": "MA" + } + ], + "text": "Massachusetts" + } + } + ], + "system": "http://www.acme.org/practitioners", + "value": "25456" + } + ], + "name": [ + { + "family": "Bone", + "given": [ + "Ronald" + ], + "prefix": [ + "Dr" + ] + } + ], + "address": [ + { + "use": "work", + "line": [ + "1003 Healthcare Drive" + ], + "city": "Amherst", + "state": "MA", + "postalCode": "01002" + } + ] +} \ No newline at end of file diff --git a/fhirData/feature-cs/r4/Practitioner-davinci-susan-watson.json b/fhirData/feature-cs/r4/Practitioner-davinci-susan-watson.json new file mode 100644 index 0000000..2f10b5c --- /dev/null +++ b/fhirData/feature-cs/r4/Practitioner-davinci-susan-watson.json @@ -0,0 +1,36 @@ +{ + "resourceType" : "Practitioner", + "id" : "davinci-susan-watson", + "meta" : { + "profile" : [ + "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitioner" + ], + "tag": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", + "code": "HTEST", + "display": "test health data" + } + ] + }, + "identifier" : [ + { + "system" : "http://hl7.org/fhir/sid/us-npi", + "value" : "987654321" + } + ], + "name" : [ + { + "family" : "WATSON", + "given" : [ + "SUSAN" + ] + } + ], + "telecom" : [ + { + "system" : "phone", + "value" : "4029993456" + } + ] +} \ No newline at end of file diff --git a/fhirData/feature-cs/r4/PractitionerRole-referral-example.json b/fhirData/feature-cs/r4/PractitionerRole-referral-example.json new file mode 100644 index 0000000..68cc963 --- /dev/null +++ b/fhirData/feature-cs/r4/PractitionerRole-referral-example.json @@ -0,0 +1,17 @@ +{ + "resourceType" : "PractitionerRole", + "id" : "ReferralPractitionerRoleExample", + "meta" : { + "profile" : [ + "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitionerrole" + ] + }, + "practitioner" : { + "reference" : "Practitioner/davinci-susan-watson" + }, + "location" : [ + { + "reference" : "Location/davinci-example-location" + } + ] +} \ No newline at end of file diff --git a/fhirData/feature-cs/r4/PractitionerRole-surgical-example.json b/fhirData/feature-cs/r4/PractitionerRole-surgical-example.json new file mode 100644 index 0000000..78a5bb2 --- /dev/null +++ b/fhirData/feature-cs/r4/PractitionerRole-surgical-example.json @@ -0,0 +1,17 @@ +{ + "resourceType" : "PractitionerRole", + "id" : "SurgicalPractitionerRoleExample", + "meta" : { + "profile" : [ + "http://hl7.org/fhir/us/davinci-pas/StructureDefinition/profile-practitionerrole" + ] + }, + "practitioner" : { + "reference" : "Practitioner/davinci-susan-watson" + }, + "location" : [ + { + "reference" : "Location/davinci-example-location" + } + ] +} \ No newline at end of file diff --git a/fhirData/feature-cs/r4/patient-example.json b/fhirData/feature-cs/r4/patient-example.json new file mode 100644 index 0000000..3ba2839 --- /dev/null +++ b/fhirData/feature-cs/r4/patient-example.json @@ -0,0 +1,170 @@ +{ + "resourceType": "Patient", + "id": "example", + "identifier": [ + { + "use": "usual", + "type": { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0203", + "code": "MR" + } + ] + }, + "system": "urn:oid:1.2.36.146.595.217.0.1", + "value": "12345", + "period": { + "start": "2001-05-06" + }, + "assigner": { + "display": "Acme Healthcare" + } + } + ], + "active": true, + "name": [ + { + "use": "official", + "family": "Chalmers", + "given": [ + "Peter", + "James" + ] + }, + { + "use": "usual", + "given": [ + "Jim" + ] + }, + { + "use": "maiden", + "family": "Windsor", + "given": [ + "Peter", + "James" + ], + "period": { + "end": "2002" + } + } + ], + "telecom": [ + { + "use": "home" + }, + { + "system": "phone", + "value": "(03) 5555 6473", + "use": "work", + "rank": 1 + }, + { + "system": "phone", + "value": "(03) 3410 5613", + "use": "mobile", + "rank": 2 + }, + { + "system": "phone", + "value": "(03) 5555 8834", + "use": "old", + "period": { + "end": "2014" + } + } + ], + "gender": "male", + "birthDate": "1974-12-25", + "_birthDate": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-birthTime", + "valueDateTime": "1974-12-25T14:35:45-05:00" + } + ] + }, + "deceasedBoolean": false, + "address": [ + { + "use": "home", + "type": "both", + "text": "534 Erewhon St PeasantVille, Rainbow, Vic 3999", + "line": [ + "534 Erewhon St" + ], + "city": "PleasantVille", + "district": "Rainbow", + "state": "Vic", + "postalCode": "3999", + "period": { + "start": "1974-12-25" + } + } + ], + "contact": [ + { + "relationship": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0131", + "code": "N" + } + ] + } + ], + "name": { + "family": "du Marché", + "_family": { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/humanname-own-prefix", + "valueString": "VV" + } + ] + }, + "given": [ + "Bénédicte" + ] + }, + "telecom": [ + { + "system": "phone", + "value": "+33 (237) 998327" + } + ], + "address": { + "use": "home", + "type": "both", + "line": [ + "534 Erewhon St" + ], + "city": "PleasantVille", + "district": "Rainbow", + "state": "Vic", + "postalCode": "3999", + "period": { + "start": "1974-12-25" + } + }, + "gender": "female", + "period": { + "start": "2012" + } + } + ], + "managingOrganization": { + "reference": "Organization/1" + }, + "meta": { + "tag": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason", + "code": "HTEST", + "display": "test health data" + } + ] + } +} \ No newline at end of file diff --git a/src/fhir-candle/Services/FhirPackageService.cs b/src/fhir-candle/Services/FhirPackageService.cs index 19b5654..63bbc0b 100644 --- a/src/fhir-candle/Services/FhirPackageService.cs +++ b/src/fhir-candle/Services/FhirPackageService.cs @@ -429,11 +429,17 @@ public async Task> InstallPackages( return; } - latestRecs.Append((pr, server)); + latestRecs.Add((pr, server)); }); - await System.Threading.Tasks.Task.WhenAll(tasks); + Task t = System.Threading.Tasks.Task.WhenAll(tasks); + try + { + await t.WaitAsync(TimeSpan.FromSeconds(30)); + } + catch { } + if (latestRecs.Count == 0) { return (PackageReference.None, null);