vet-data-utils-ts 0.4.10 → 0.4.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,14 +13,21 @@ Reusable Communication screens receive immutable workflow presets from
13
13
  FHIR `notification` plus HL7 v3 ActReason `HRESCH` and does not expose a topic
14
14
  picker. See [`docs/communication-inbox-filters.md`](docs/communication-inbox-filters.md).
15
15
 
16
- Veterinary clinical entry screens obtain their allowed coding systems from
17
- `vet-data-utils-ts/clinical-terminology`. Observations and diagnostic reports
18
- use LOINC; conditions additionally support ICD-10; SNOMED CT is offered for
19
- conditions, procedures and allergies only when the selected ISO country is an
20
- official SNOMED member territory. A returned candidate is never accepted
16
+ Veterinary clinical entry screens obtain browser-safe source identifiers and
17
+ response types from `vet-data-utils-ts/clinical-terminology`; the terminology
18
+ server remains authoritative for each FHIR field. Observations and diagnostic
19
+ reports use LOINC and conditions additionally support ICD-10. SNOMED GPS is
20
+ globally available, while full SNOMED CT and the veterinary extension are
21
+ offered only when the selected ISO country is an official member territory.
22
+ These sources share one FHIR system URI, so portals must preserve the source
23
+ scope returned by the server rather than authorizing from the URI. A returned candidate is never accepted
21
24
  automatically: the professional must review and select it before creating the
22
25
  FHIR resource. Membership does not replace national edition, attribution or
23
26
  affiliate-license requirements. See the [official member list](https://www.snomed.org/members).
27
+ Veterinary immunizations use the distinct WHO ATCvet classification (group QI
28
+ for immunologicals); ordinary human ATC is not substituted for it. Veterinary
29
+ allergy product coding may also use ATCvet, while manifestations use an allowed
30
+ SNOMED source.
24
31
 
25
32
  The deferred spreadsheet shape for member and employee role assignments is
26
33
  documented in [`docs/member-import-contract.md`](docs/member-import-contract.md).
@@ -2,6 +2,46 @@ export declare const VeterinaryClinicalTerminologySystems: Readonly<{
2
2
  readonly Loinc: "http://loinc.org";
3
3
  readonly SnomedCt: "http://snomed.info/sct";
4
4
  readonly Icd10: "http://hl7.org/fhir/sid/icd-10";
5
+ /** WHO Collaborating Centre ATCvet classification, distinct from human ATC. */
6
+ readonly AtcVet: "http://www.whocc.no/atcvet";
7
+ }>;
8
+ /**
9
+ * Source scopes are authorization/content boundaries, not Coding.system URIs.
10
+ * GPS, full SNOMED CT and the veterinary extension intentionally share the
11
+ * canonical SNOMED system URI.
12
+ * https://www.snomed.org/gps
13
+ */
14
+ export declare const VeterinaryTerminologySourceScopes: Readonly<{
15
+ readonly Loinc: "LNC";
16
+ readonly SnomedGps: "SNOMED_GPS";
17
+ readonly SnomedCt: "SNOMED_CT";
18
+ readonly SnomedVeterinary: "SNOMEDCT_VET";
19
+ readonly Icd10: "ICD10";
20
+ readonly AtcVet: "ATCVET";
21
+ }>;
22
+ export type VeterinaryTerminologySourceScope = typeof VeterinaryTerminologySourceScopes[keyof typeof VeterinaryTerminologySourceScopes];
23
+ export type VeterinaryTerminologyCapability = Readonly<{
24
+ type: 'terminology-capability';
25
+ id: string;
26
+ attributes: Readonly<{
27
+ fhirVersion: 'R4';
28
+ sector: string;
29
+ jurisdiction: string;
30
+ resourceType: VeterinaryCodedResourceType;
31
+ elementPath: string;
32
+ flatClaims?: Readonly<{
33
+ code: string;
34
+ text: string;
35
+ display: string;
36
+ }>;
37
+ defaultSource: VeterinaryTerminologySourceScope;
38
+ sources: readonly Readonly<{
39
+ id: VeterinaryTerminologySourceScope;
40
+ system: string;
41
+ availability: 'hosted' | 'catalog';
42
+ globallyUsable: boolean;
43
+ }>[];
44
+ }>;
5
45
  }>;
6
46
  /**
7
47
  * ISO 3166-1 alpha-2 territories enumerated by the official SNOMED
@@ -14,5 +54,7 @@ export declare const VeterinaryClinicalTerminologySystems: Readonly<{
14
54
  * release, edition, attribution or affiliate-license requirements.
15
55
  */
16
56
  export declare const SnomedMemberCountryCodes: readonly ["AR", "BZ", "CA", "CL", "CR", "SV", "JM", "US", "UY", "AD", "AT", "BE", "HR", "CY", "CZ", "DK", "EE", "FI", "FR", "DE", "HU", "IS", "IE", "IL", "JO", "LV", "LT", "LU", "MT", "NL", "NO", "PT", "QA", "SI", "SA", "SK", "ZA", "ES", "SE", "CH", "AE", "GB", "AU", "BN", "HK", "IN", "ID", "MY", "MN", "NZ", "KR", "SG", "TH", "UZ"];
17
- export type VeterinaryCodedResourceType = 'Condition' | 'Procedure' | 'DiagnosticReport' | 'Observation' | 'AllergyIntolerance';
57
+ export type VeterinaryCodedResourceType = 'Condition' | 'Procedure' | 'DiagnosticReport' | 'Observation' | 'AllergyIntolerance' | 'Immunization';
58
+ /** Resource-level summary; field-level authority comes from the terminology API capability response. */
59
+ export declare function veterinaryTerminologySourcesFor(resourceType: VeterinaryCodedResourceType, countryCode: string): readonly VeterinaryTerminologySourceScope[];
18
60
  export declare function veterinaryTerminologySystemsFor(resourceType: VeterinaryCodedResourceType, countryCode: string): readonly string[];
@@ -2,6 +2,22 @@ export const VeterinaryClinicalTerminologySystems = Object.freeze({
2
2
  Loinc: 'http://loinc.org',
3
3
  SnomedCt: 'http://snomed.info/sct',
4
4
  Icd10: 'http://hl7.org/fhir/sid/icd-10',
5
+ /** WHO Collaborating Centre ATCvet classification, distinct from human ATC. */
6
+ AtcVet: 'http://www.whocc.no/atcvet',
7
+ });
8
+ /**
9
+ * Source scopes are authorization/content boundaries, not Coding.system URIs.
10
+ * GPS, full SNOMED CT and the veterinary extension intentionally share the
11
+ * canonical SNOMED system URI.
12
+ * https://www.snomed.org/gps
13
+ */
14
+ export const VeterinaryTerminologySourceScopes = Object.freeze({
15
+ Loinc: 'LNC',
16
+ SnomedGps: 'SNOMED_GPS',
17
+ SnomedCt: 'SNOMED_CT',
18
+ SnomedVeterinary: 'SNOMEDCT_VET',
19
+ Icd10: 'ICD10',
20
+ AtcVet: 'ATCVET',
5
21
  });
6
22
  /**
7
23
  * ISO 3166-1 alpha-2 territories enumerated by the official SNOMED
@@ -20,15 +36,35 @@ export const SnomedMemberCountryCodes = Object.freeze([
20
36
  'SI', 'SA', 'SK', 'ZA', 'ES', 'SE', 'CH', 'AE', 'GB',
21
37
  'AU', 'BN', 'HK', 'IN', 'ID', 'MY', 'MN', 'NZ', 'KR', 'SG', 'TH', 'UZ',
22
38
  ]);
23
- export function veterinaryTerminologySystemsFor(resourceType, countryCode) {
39
+ /** Resource-level summary; field-level authority comes from the terminology API capability response. */
40
+ export function veterinaryTerminologySourcesFor(resourceType, countryCode) {
24
41
  if (resourceType === 'Observation' || resourceType === 'DiagnosticReport') {
25
- return [VeterinaryClinicalTerminologySystems.Loinc];
42
+ return [VeterinaryTerminologySourceScopes.Loinc];
26
43
  }
27
44
  const permitsSnomed = SnomedMemberCountryCodes.includes(countryCode.toUpperCase());
28
- if (resourceType === 'Condition') {
29
- return permitsSnomed
30
- ? [VeterinaryClinicalTerminologySystems.SnomedCt, VeterinaryClinicalTerminologySystems.Icd10]
31
- : [VeterinaryClinicalTerminologySystems.Icd10];
32
- }
33
- return permitsSnomed ? [VeterinaryClinicalTerminologySystems.SnomedCt] : [];
45
+ const clinical = permitsSnomed
46
+ ? [
47
+ VeterinaryTerminologySourceScopes.SnomedGps,
48
+ VeterinaryTerminologySourceScopes.SnomedCt,
49
+ VeterinaryTerminologySourceScopes.SnomedVeterinary,
50
+ ]
51
+ : [VeterinaryTerminologySourceScopes.SnomedGps];
52
+ if (resourceType === 'Condition')
53
+ return [...clinical, VeterinaryTerminologySourceScopes.Icd10];
54
+ if (resourceType === 'Immunization')
55
+ return [VeterinaryTerminologySourceScopes.AtcVet, ...clinical];
56
+ if (resourceType === 'AllergyIntolerance')
57
+ return [...clinical, VeterinaryTerminologySourceScopes.AtcVet];
58
+ return clinical;
59
+ }
60
+ export function veterinaryTerminologySystemsFor(resourceType, countryCode) {
61
+ const sourceSystem = {
62
+ [VeterinaryTerminologySourceScopes.Loinc]: VeterinaryClinicalTerminologySystems.Loinc,
63
+ [VeterinaryTerminologySourceScopes.SnomedGps]: VeterinaryClinicalTerminologySystems.SnomedCt,
64
+ [VeterinaryTerminologySourceScopes.SnomedCt]: VeterinaryClinicalTerminologySystems.SnomedCt,
65
+ [VeterinaryTerminologySourceScopes.SnomedVeterinary]: VeterinaryClinicalTerminologySystems.SnomedCt,
66
+ [VeterinaryTerminologySourceScopes.Icd10]: VeterinaryClinicalTerminologySystems.Icd10,
67
+ [VeterinaryTerminologySourceScopes.AtcVet]: VeterinaryClinicalTerminologySystems.AtcVet,
68
+ };
69
+ return [...new Set(veterinaryTerminologySourcesFor(resourceType, countryCode).map((source) => sourceSystem[source]))];
34
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vet-data-utils-ts",
3
- "version": "0.4.10",
3
+ "version": "0.4.12",
4
4
  "description": "Browser-safe governed VetChain data contracts",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Connecting Solution & Applications Ltd",