vet-data-utils-ts 0.4.11 → 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,17 +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).
24
27
  Veterinary immunizations use the distinct WHO ATCvet classification (group QI
25
- for immunologicals), with SNOMED CT as an additional candidate system where
26
- territorial use is permitted; ordinary human ATC is not substituted for it.
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.
27
31
 
28
32
  The deferred spreadsheet shape for member and employee role assignments is
29
33
  documented in [`docs/member-import-contract.md`](docs/member-import-contract.md).
@@ -5,6 +5,44 @@ export declare const VeterinaryClinicalTerminologySystems: Readonly<{
5
5
  /** WHO Collaborating Centre ATCvet classification, distinct from human ATC. */
6
6
  readonly AtcVet: "http://www.whocc.no/atcvet";
7
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
+ }>;
45
+ }>;
8
46
  /**
9
47
  * ISO 3166-1 alpha-2 territories enumerated by the official SNOMED
10
48
  * International member page on 2026-09-05.
@@ -17,4 +55,6 @@ export declare const VeterinaryClinicalTerminologySystems: Readonly<{
17
55
  */
18
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"];
19
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[];
20
60
  export declare function veterinaryTerminologySystemsFor(resourceType: VeterinaryCodedResourceType, countryCode: string): readonly string[];
@@ -5,6 +5,20 @@ export const VeterinaryClinicalTerminologySystems = Object.freeze({
5
5
  /** WHO Collaborating Centre ATCvet classification, distinct from human ATC. */
6
6
  AtcVet: 'http://www.whocc.no/atcvet',
7
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',
21
+ });
8
22
  /**
9
23
  * ISO 3166-1 alpha-2 territories enumerated by the official SNOMED
10
24
  * International member page on 2026-09-05.
@@ -22,23 +36,35 @@ export const SnomedMemberCountryCodes = Object.freeze([
22
36
  'SI', 'SA', 'SK', 'ZA', 'ES', 'SE', 'CH', 'AE', 'GB',
23
37
  'AU', 'BN', 'HK', 'IN', 'ID', 'MY', 'MN', 'NZ', 'KR', 'SG', 'TH', 'UZ',
24
38
  ]);
25
- 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) {
26
41
  if (resourceType === 'Observation' || resourceType === 'DiagnosticReport') {
27
- return [VeterinaryClinicalTerminologySystems.Loinc];
42
+ return [VeterinaryTerminologySourceScopes.Loinc];
28
43
  }
29
44
  const permitsSnomed = SnomedMemberCountryCodes.includes(countryCode.toUpperCase());
30
- if (resourceType === 'Condition') {
31
- return permitsSnomed
32
- ? [VeterinaryClinicalTerminologySystems.SnomedCt, VeterinaryClinicalTerminologySystems.Icd10]
33
- : [VeterinaryClinicalTerminologySystems.Icd10];
34
- }
35
- if (resourceType === 'Immunization') {
36
- // ATCvet group QI owns veterinary immunological products. SNOMED CT may
37
- // additionally express a vaccine concept where territorial use permits it.
38
- // https://atcddd.fhi.no/atcvet/atcvet_index/
39
- return permitsSnomed
40
- ? [VeterinaryClinicalTerminologySystems.AtcVet, VeterinaryClinicalTerminologySystems.SnomedCt]
41
- : [VeterinaryClinicalTerminologySystems.AtcVet];
42
- }
43
- 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]))];
44
70
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vet-data-utils-ts",
3
- "version": "0.4.11",
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",