vet-data-utils-ts 0.4.3 → 0.4.7

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
@@ -8,6 +8,10 @@ Current surfaces cover the canonical animal-card DID, veterinary summary
8
8
  sections, animal-only emergency data, pseudonymous DigitalTwin search input and
9
9
  veterinary assistant intents.
10
10
 
11
+ The deferred spreadsheet shape for member and employee role assignments is
12
+ documented in [`docs/member-import-contract.md`](docs/member-import-contract.md).
13
+ It is not an implemented importer API.
14
+
11
15
  ## Active sector extension
12
16
 
13
17
  `vet-data-utils-ts/sectors` extends the frozen CORE catalog without changing
@@ -36,6 +40,13 @@ controller and six independent index participation roles. It rejects a second
36
40
  `taxId` and every PIN field: profile protection happens immediately after
37
41
  login, before any application screen.
38
42
 
43
+ `organizationServiceTypeForParticipationRoles()` projects those explicit
44
+ business roles into the canonical GW `Service.serviceType` capability claim.
45
+ Index and Digital Twin providers receive the corresponding `cruds` capability;
46
+ consumers receive only `rs`. The application continues to retain the six roles
47
+ separately, so this operational projection never erases who provides the index
48
+ service and who merely provides or consumes its data.
49
+
39
50
  The financial surface defines provider-neutral flat claims for FHIR R5
40
51
  `Account`, `Invoice`, `PaymentNotice` and `PaymentReconciliation`. `Account`
41
52
  tracks charges and balances; the responsible party is represented through
@@ -33,6 +33,13 @@ export type ReusableOrganizationApplication = Readonly<{
33
33
  }>;
34
34
  participationRoles: readonly OrganizationParticipationRole[];
35
35
  }>;
36
+ /**
37
+ * Converts the six explicit application roles into GW's canonical capability
38
+ * claim. Business roles remain distinct in the application and credential;
39
+ * this projection only grants their corresponding provider or reader runtime
40
+ * operations and removes duplicates.
41
+ */
42
+ export declare function organizationServiceTypeForParticipationRoles(roles: readonly OrganizationParticipationRole[]): string;
36
43
  /**
37
44
  * Validates only reusable organization-application business data.
38
45
  *
@@ -1,4 +1,5 @@
1
1
  import { isIso3166CountryCode, isIso3166SubdivisionForCountry } from './iso-jurisdictions.js';
2
+ import { serializeServiceCapabilityTokens, ServiceCapability, } from 'gdc-common-utils-ts/constants/service-capabilities';
2
3
  export const OrganizationOfficialIdTypes = Object.freeze({
3
4
  Tax: 'TAX',
4
5
  EmployerIdentificationNumber: 'EIN',
@@ -14,6 +15,32 @@ export const OrganizationParticipationRoles = Object.freeze({
14
15
  });
15
16
  const officialIdTypes = new Set(Object.values(OrganizationOfficialIdTypes));
16
17
  const participationRoles = new Set(Object.values(OrganizationParticipationRoles));
18
+ /**
19
+ * Converts the six explicit application roles into GW's canonical capability
20
+ * claim. Business roles remain distinct in the application and credential;
21
+ * this projection only grants their corresponding provider or reader runtime
22
+ * operations and removes duplicates.
23
+ */
24
+ export function organizationServiceTypeForParticipationRoles(roles) {
25
+ const capabilities = roles.map(role => {
26
+ switch (role) {
27
+ case OrganizationParticipationRoles.IndividualIndexServiceProvider:
28
+ case OrganizationParticipationRoles.IndividualIndexDataProvider:
29
+ return ServiceCapability.IndexProvider;
30
+ case OrganizationParticipationRoles.IndividualIndexDataConsumer:
31
+ return ServiceCapability.IndexReader;
32
+ case OrganizationParticipationRoles.DigitalTwinIndexServiceProvider:
33
+ case OrganizationParticipationRoles.DigitalTwinDataProvider:
34
+ return ServiceCapability.DigitalTwinProvider;
35
+ case OrganizationParticipationRoles.DigitalTwinDataConsumer:
36
+ return ServiceCapability.DigitalTwinReader;
37
+ }
38
+ });
39
+ const serviceType = serializeServiceCapabilityTokens(capabilities);
40
+ if (!serviceType)
41
+ throw new TypeError('organization_participation_role_required');
42
+ return serviceType;
43
+ }
17
44
  /**
18
45
  * Validates only reusable organization-application business data.
19
46
  *
@@ -4,6 +4,18 @@ export type VeterinarySummarySection = Readonly<{
4
4
  value: `LOINC|${string}`;
5
5
  titleEn: string;
6
6
  }>;
7
+ /**
8
+ * Product-owned display concepts used by high-level veterinary workflows.
9
+ *
10
+ * They deliberately carry no invented terminology-system code. A deployment
11
+ * may add a governed coding later, while claims-first research projection can
12
+ * safely index the non-identifying `Coding.display` value today.
13
+ */
14
+ export declare const VeterinaryClinicalConcepts: Readonly<{
15
+ ClinicalNote: Readonly<{
16
+ display: "Veterinary clinical note";
17
+ }>;
18
+ }>;
7
19
  /** VetChain-owned clinical section catalog. It is not an alias of human IPS. */
8
20
  export declare const VeterinarySummarySections: Readonly<{
9
21
  Problems: Readonly<{
@@ -1,3 +1,13 @@
1
+ /**
2
+ * Product-owned display concepts used by high-level veterinary workflows.
3
+ *
4
+ * They deliberately carry no invented terminology-system code. A deployment
5
+ * may add a governed coding later, while claims-first research projection can
6
+ * safely index the non-identifying `Coding.display` value today.
7
+ */
8
+ export const VeterinaryClinicalConcepts = Object.freeze({
9
+ ClinicalNote: Object.freeze({ display: 'Veterinary clinical note' }),
10
+ });
1
11
  function loinc(code, titleEn) {
2
12
  return Object.freeze({ system: 'http://loinc.org', code, value: `LOINC|${code}`, titleEn });
3
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vet-data-utils-ts",
3
- "version": "0.4.3",
3
+ "version": "0.4.7",
4
4
  "description": "Browser-safe governed VetChain data contracts",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Connecting Solution & Applications Ltd",