aw-spec-cli 0.1.5 → 0.1.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.
Files changed (205) hide show
  1. package/assets/.agents/agent.json +1 -1
  2. package/assets/.agents/skills/{aw-spec-orch → appweaver}/SKILL.md +10 -10
  3. package/assets/.agents/skills/{aw-spec-orch-demo → appweaver-demo}/SKILL.md +9 -9
  4. package/assets/.claude/agent.json +1 -1
  5. package/assets/.claude/skills/{aw-spec-orch → appweaver}/SKILL.md +10 -10
  6. package/assets/.claude/skills/{aw-spec-orch-demo → appweaver-demo}/SKILL.md +9 -9
  7. package/assets/.kilocode/agent.json +1 -1
  8. package/assets/.kilocode/workflows/{aw-spec-orch-demo.md → appweaver-demo.md} +9 -9
  9. package/assets/.kilocode/workflows/{aw-spec-orch.md → appweaver.md} +10 -10
  10. package/assets/docs/pharma-constitution.my-ref.md +86 -0
  11. package/dist/utils/paths.js +1 -1
  12. package/dist/utils/paths.js.map +1 -1
  13. package/package.json +1 -1
  14. package/assets/.aw-spec/DESIGN-FORMAT.md +0 -151
  15. package/assets/.aw-spec/ORCH-DIALECT.md +0 -156
  16. package/assets/.aw-spec/RULE-PARTITION.md +0 -126
  17. package/assets/.aw-spec/domain.json +0 -3
  18. package/assets/.aw-spec/extensions/.registry +0 -19
  19. package/assets/.aw-spec/extensions/agent-context/README.md +0 -57
  20. package/assets/.aw-spec/extensions/agent-context/agent-context-config.yml +0 -4
  21. package/assets/.aw-spec/extensions/agent-context/commands/aw-spec.agent-context.update.md +0 -26
  22. package/assets/.aw-spec/extensions/agent-context/extension.yml +0 -37
  23. package/assets/.aw-spec/extensions/agent-context/scripts/bash/update-agent-context.sh +0 -201
  24. package/assets/.aw-spec/extensions/agent-context/scripts/powershell/update-agent-context.ps1 +0 -237
  25. package/assets/.aw-spec/extensions.yml +0 -16
  26. package/assets/.aw-spec/feature.json +0 -3
  27. package/assets/.aw-spec/init-options.json +0 -9
  28. package/assets/.aw-spec/integration.json +0 -15
  29. package/assets/.aw-spec/integrations/aw-spec.manifest.json +0 -9
  30. package/assets/.aw-spec/interpreter/run-skill.py +0 -1158
  31. package/assets/.aw-spec/memory/constitution.md +0 -50
  32. package/assets/.aw-spec/orchestrator/AGENT-PROFILE.md +0 -94
  33. package/assets/.aw-spec/orchestrator/README.md +0 -300
  34. package/assets/.aw-spec/orchestrator/adapters/claude_agent_sdk.py +0 -74
  35. package/assets/.aw-spec/orchestrator/adapters/google_antigravity.py +0 -74
  36. package/assets/.aw-spec/orchestrator/modules/delta-design.orch.yaml +0 -105
  37. package/assets/.aw-spec/orchestrator/modules/delta-spec.orch.yaml +0 -79
  38. package/assets/.aw-spec/orchestrator/modules/domain-select.orch.yaml +0 -81
  39. package/assets/.aw-spec/orchestrator/modules/tech-select.orch.yaml +0 -75
  40. package/assets/.aw-spec/orchestrator/orchestrator.py +0 -1721
  41. package/assets/.aw-spec/orchestrator/rev-templates/ai-rules.reference.md +0 -40
  42. package/assets/.aw-spec/orchestrator/rev-templates/comandrulemap.skeleton.md +0 -59
  43. package/assets/.aw-spec/orchestrator/rev-templates/commandtechrulemap.skeleton.md +0 -97
  44. package/assets/.aw-spec/orchestrator/rev-templates/domain-constitution.skeleton.md +0 -61
  45. package/assets/.aw-spec/orchestrator/rev-templates/domain-requirements.skeleton.md +0 -48
  46. package/assets/.aw-spec/orchestrator/rev-templates/domain-rule-file.skeleton.md +0 -39
  47. package/assets/.aw-spec/orchestrator/rev-templates/technical-constitution.skeleton.md +0 -106
  48. package/assets/.aw-spec/orchestrator/rev-templates/technical-rule-file.skeleton.md +0 -54
  49. package/assets/.aw-spec/orchestrator/workflows/_smoke.orch.yaml +0 -160
  50. package/assets/.aw-spec/orchestrator/workflows/aw-spec-add-component.orch.yaml +0 -244
  51. package/assets/.aw-spec/orchestrator/workflows/aw-spec-adopt.orch.yaml +0 -775
  52. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-delta-design.orch.yaml +0 -248
  53. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-design.orch.yaml +0 -261
  54. package/assets/.aw-spec/orchestrator/workflows/aw-spec-analyze-slice.orch.yaml +0 -425
  55. package/assets/.aw-spec/orchestrator/workflows/aw-spec-build.orch.yaml +0 -188
  56. package/assets/.aw-spec/orchestrator/workflows/aw-spec-characterize.orch.yaml +0 -474
  57. package/assets/.aw-spec/orchestrator/workflows/aw-spec-close-delta.orch.yaml +0 -181
  58. package/assets/.aw-spec/orchestrator/workflows/aw-spec-constitution.orch.yaml +0 -284
  59. package/assets/.aw-spec/orchestrator/workflows/aw-spec-demo.orch.yaml +0 -103
  60. package/assets/.aw-spec/orchestrator/workflows/aw-spec-dependency-tree.orch.yaml +0 -69
  61. package/assets/.aw-spec/orchestrator/workflows/aw-spec-deploy.orch.yaml +0 -85
  62. package/assets/.aw-spec/orchestrator/workflows/aw-spec-design.orch.yaml +0 -382
  63. package/assets/.aw-spec/orchestrator/workflows/aw-spec-finalize-delta.orch.yaml +0 -382
  64. package/assets/.aw-spec/orchestrator/workflows/aw-spec-foundation.orch.yaml +0 -246
  65. package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement-delta.orch.yaml +0 -231
  66. package/assets/.aw-spec/orchestrator/workflows/aw-spec-implement.orch.yaml +0 -258
  67. package/assets/.aw-spec/orchestrator/workflows/aw-spec-inventory.orch.yaml +0 -236
  68. package/assets/.aw-spec/orchestrator/workflows/aw-spec-onboard.orch.yaml +0 -949
  69. package/assets/.aw-spec/orchestrator/workflows/aw-spec-parity.orch.yaml +0 -293
  70. package/assets/.aw-spec/orchestrator/workflows/aw-spec-run.orch.yaml +0 -177
  71. package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-domain.orch.yaml +0 -79
  72. package/assets/.aw-spec/orchestrator/workflows/aw-spec-select-feature.orch.yaml +0 -128
  73. package/assets/.aw-spec/orchestrator/workflows/aw-spec-specify.orch.yaml +0 -412
  74. package/assets/.aw-spec/scripts/bash/aw-inventory.sh +0 -14
  75. package/assets/.aw-spec/scripts/bash/aw-parity.sh +0 -13
  76. package/assets/.aw-spec/scripts/bash/aw-rev-constitution.sh +0 -13
  77. package/assets/.aw-spec/scripts/bash/aw-spec-actions.sh +0 -1899
  78. package/assets/.aw-spec/scripts/bash/aw-xref.sh +0 -15
  79. package/assets/.aw-spec/scripts/bash/common.sh +0 -533
  80. package/assets/.aw-spec/scripts/powershell/aw-inventory.ps1 +0 -14
  81. package/assets/.aw-spec/scripts/powershell/aw-parity.ps1 +0 -13
  82. package/assets/.aw-spec/scripts/powershell/aw-rev-constitution.ps1 +0 -13
  83. package/assets/.aw-spec/scripts/powershell/aw-spec-actions.ps1 +0 -1563
  84. package/assets/.aw-spec/scripts/powershell/aw-xref.ps1 +0 -15
  85. package/assets/.aw-spec/scripts/python/aw-inventory.py +0 -683
  86. package/assets/.aw-spec/scripts/python/aw-parity.py +0 -380
  87. package/assets/.aw-spec/scripts/python/aw-rev-constitution.py +0 -312
  88. package/assets/.aw-spec/scripts/python/aw-xref.py +0 -1330
  89. package/assets/.aw-spec/scripts/python/validate_okf.py +0 -349
  90. package/assets/.aw-spec/templates/constitution-domain-template.md +0 -75
  91. package/assets/.aw-spec/templates/constitution-technical-template.md +0 -70
  92. package/assets/.aw-spec/templates/delta-design-template.md +0 -69
  93. package/assets/.aw-spec/templates/delta-spec-template.md +0 -60
  94. package/assets/.aw-spec/templates/design-template.md +0 -383
  95. package/assets/.aw-spec/templates/okf-concept-template.md +0 -103
  96. package/assets/.aw-spec/templates/parity-manifest-template.json +0 -49
  97. package/assets/.aw-spec/templates/source-map-template.md +0 -85
  98. package/assets/.aw-spec/templates/spec-template.md +0 -252
  99. package/assets/docs/ModularMonolith/ModularMonolith.Reference.pack.txt +0 -25248
  100. package/assets/docs/ModularMonolith/ModularMonolith.pack.txt +0 -5726
  101. package/assets/docs/ModularMonolith/pack-foundation.ps1 +0 -145
  102. package/assets/docs/ModularMonolith/pack-foundation.sh +0 -196
  103. package/assets/docs/ModularMonolith/pack-reference-foundation.ps1 +0 -157
  104. package/assets/docs/ModularMonolith/pack-reference-foundation.sh +0 -209
  105. package/assets/docs/ModularMonolith/unpack-foundation.ps1 +0 -126
  106. package/assets/docs/ModularMonolith/unpack-foundation.sh +0 -217
  107. package/assets/docs/ModularMonolith/unpack-reference-foundation.ps1 +0 -129
  108. package/assets/docs/ModularMonolith/unpack-reference-foundation.sh +0 -218
  109. package/assets/docs/README.md +0 -106
  110. package/assets/docs/VerticalSlice/PACKAGING.md +0 -185
  111. package/assets/docs/VerticalSlice/VerticalSlice.Reference.pack.txt +0 -19318
  112. package/assets/docs/VerticalSlice/VerticalSlice.pack.txt +0 -2833
  113. package/assets/docs/VerticalSlice/pack-foundation.ps1 +0 -145
  114. package/assets/docs/VerticalSlice/pack-foundation.sh +0 -196
  115. package/assets/docs/VerticalSlice/pack-reference-foundation.ps1 +0 -157
  116. package/assets/docs/VerticalSlice/pack-reference-foundation.sh +0 -209
  117. package/assets/docs/VerticalSlice/unpack-foundation.ps1 +0 -126
  118. package/assets/docs/VerticalSlice/unpack-foundation.sh +0 -217
  119. package/assets/docs/VerticalSlice/unpack-reference-foundation.ps1 +0 -129
  120. package/assets/docs/VerticalSlice/unpack-reference-foundation.sh +0 -218
  121. package/assets/docs/architecture/clean-architecture.md +0 -71
  122. package/assets/docs/architecture/cqrs.md +0 -141
  123. package/assets/docs/architecture/eventing.md +0 -83
  124. package/assets/docs/architecture/folder-structure.md +0 -61
  125. package/assets/docs/architecture/modular-monolith.md +0 -47
  126. package/assets/docs/architecture/persistence.md +0 -269
  127. package/assets/docs/architecture/testing.md +0 -55
  128. package/assets/docs/architecture/vertical-slices.md +0 -201
  129. package/assets/docs/components/Email/README.md +0 -119
  130. package/assets/docs/components/Email/ReferenceEndpoints/SendEmailEndpoint.cs +0 -84
  131. package/assets/docs/components/Email/integration.md +0 -300
  132. package/assets/docs/components/Jobs/README.md +0 -113
  133. package/assets/docs/components/Jobs/integration.md +0 -259
  134. package/assets/docs/components/QrGenerator/README.md +0 -85
  135. package/assets/docs/components/QrGenerator/ReferenceEndpoints/GenerateQrEndpoint.cs +0 -57
  136. package/assets/docs/components/QrGenerator/integration.md +0 -230
  137. package/assets/docs/components/README.md +0 -74
  138. package/assets/docs/domain/domain-driven-design.md +0 -212
  139. package/assets/docs/domainspecs/healthcare/ai-rules.domain.md +0 -34
  140. package/assets/docs/domainspecs/healthcare/api-versioning.domain.md +0 -17
  141. package/assets/docs/domainspecs/healthcare/auditing.domain.md +0 -97
  142. package/assets/docs/domainspecs/healthcare/authorization.domain.md +0 -26
  143. package/assets/docs/domainspecs/healthcare/clinical-terms.md +0 -20
  144. package/assets/docs/domainspecs/healthcare/coding-standards.domain.md +0 -26
  145. package/assets/docs/domainspecs/healthcare/comandrulemap.md +0 -100
  146. package/assets/docs/domainspecs/healthcare/commandtechrulemap.md +0 -119
  147. package/assets/docs/domainspecs/healthcare/consent.md +0 -19
  148. package/assets/docs/domainspecs/healthcare/cqrs.domain.md +0 -12
  149. package/assets/docs/domainspecs/healthcare/data-classification.domain.md +0 -28
  150. package/assets/docs/domainspecs/healthcare/dependency-policy.domain.md +0 -11
  151. package/assets/docs/domainspecs/healthcare/dicom.md +0 -15
  152. package/assets/docs/domainspecs/healthcare/domain-driven-design.domain.md +0 -28
  153. package/assets/docs/domainspecs/healthcare/domain-requirements.md +0 -55
  154. package/assets/docs/domainspecs/healthcare/eventing.domain.md +0 -18
  155. package/assets/docs/domainspecs/healthcare/fhir.md +0 -36
  156. package/assets/docs/domainspecs/healthcare/folder-structure.domain.md +0 -23
  157. package/assets/docs/domainspecs/healthcare/hipaa.md +0 -34
  158. package/assets/docs/domainspecs/healthcare/hl7.md +0 -15
  159. package/assets/docs/domainspecs/healthcare/integration-terms.md +0 -21
  160. package/assets/docs/domainspecs/healthcare/persistence.domain.md +0 -20
  161. package/assets/docs/domainspecs/healthcare/terminology.md +0 -30
  162. package/assets/docs/domainspecs/healthcare/testing.domain.md +0 -15
  163. package/assets/docs/domainspecs/healthcare/vertical-slices.domain.md +0 -18
  164. package/assets/docs/domainspecs/healthcare/zero-trust.domain.md +0 -12
  165. package/assets/docs/domainspecs/pharma/ai-rules.domain.md +0 -32
  166. package/assets/docs/domainspecs/pharma/api-versioning.domain.md +0 -20
  167. package/assets/docs/domainspecs/pharma/atc.md +0 -22
  168. package/assets/docs/domainspecs/pharma/auditing.domain.md +0 -90
  169. package/assets/docs/domainspecs/pharma/authorization.domain.md +0 -25
  170. package/assets/docs/domainspecs/pharma/coding-standards.domain.md +0 -28
  171. package/assets/docs/domainspecs/pharma/comandrulemap.md +0 -108
  172. package/assets/docs/domainspecs/pharma/commandtechrulemap.md +0 -119
  173. package/assets/docs/domainspecs/pharma/cqrs.domain.md +0 -16
  174. package/assets/docs/domainspecs/pharma/data-classification.domain.md +0 -24
  175. package/assets/docs/domainspecs/pharma/data-provenance.md +0 -21
  176. package/assets/docs/domainspecs/pharma/dependency-policy.domain.md +0 -11
  177. package/assets/docs/domainspecs/pharma/domain-driven-design.domain.md +0 -36
  178. package/assets/docs/domainspecs/pharma/domain-requirements.md +0 -99
  179. package/assets/docs/domainspecs/pharma/eventing.domain.md +0 -18
  180. package/assets/docs/domainspecs/pharma/fhir.md +0 -31
  181. package/assets/docs/domainspecs/pharma/folder-structure.domain.md +0 -24
  182. package/assets/docs/domainspecs/pharma/hl7.md +0 -17
  183. package/assets/docs/domainspecs/pharma/idmp.md +0 -26
  184. package/assets/docs/domainspecs/pharma/integration-terms.md +0 -21
  185. package/assets/docs/domainspecs/pharma/ndc.md +0 -28
  186. package/assets/docs/domainspecs/pharma/persistence.domain.md +0 -23
  187. package/assets/docs/domainspecs/pharma/pharma-terms.md +0 -27
  188. package/assets/docs/domainspecs/pharma/product-lifecycle.domain.md +0 -30
  189. package/assets/docs/domainspecs/pharma/regulatory-compliance.md +0 -19
  190. package/assets/docs/domainspecs/pharma/terminology.md +0 -32
  191. package/assets/docs/domainspecs/pharma/testing.domain.md +0 -19
  192. package/assets/docs/domainspecs/pharma/vertical-slices.domain.md +0 -17
  193. package/assets/docs/domainspecs/pharma/zero-trust.domain.md +0 -12
  194. package/assets/docs/glossary/ai-rules.md +0 -59
  195. package/assets/docs/governance/api-versioning.md +0 -99
  196. package/assets/docs/governance/coding-standards.md +0 -87
  197. package/assets/docs/governance/dependency-policy.md +0 -40
  198. package/assets/docs/interop/ihe-conformance.md +0 -31
  199. package/assets/docs/requirement-spec.txt +0 -27
  200. package/assets/docs/security/auditing.md +0 -160
  201. package/assets/docs/security/authorization-matrix.md +0 -14
  202. package/assets/docs/security/authorization.md +0 -87
  203. package/assets/docs/security/data-classification.md +0 -38
  204. package/assets/docs/security/zero-trust.md +0 -76
  205. package/assets/docs/technology-constitution.md +0 -172
@@ -1,119 +0,0 @@
1
- # Healthcare Domain — Command → Technical-Rule-File Map
2
-
3
- Per-command list of the **technical** rule files loaded (via `resolve-tech` + the
4
- `tech-select` module, into the sticky standards set) for the spec-anchored
5
- orchestrator pipeline. This is the technical counterpart of `comandrulemap.md`
6
- (which maps the DOMAIN rule files).
7
-
8
- **The model:** the technical rule files (the `docs/architecture` · `docs/security` ·
9
- `docs/interop` · `docs/governance` set that used to be HARDCODED in each workflow's
10
- `standards:` block) are now CONFIGURATION — tune this map, not the workflows. The
11
- technology base itself (`constitution.technical.md`) is NOT listed here — every
12
- consumer still refers to it directly, as-is.
13
-
14
- - All paths are workspace-relative technical rule files (domain-agnostic docs/…).
15
- - `resolve-tech --command <name>` collects the `- ` bullets under `## /<name>`.
16
- - This file is the **canonical technical mapping** for the healthcare domain; it is
17
- selected whenever healthcare is the active domain (`.aw-spec/domain.json`).
18
- - A command with no heading here loads no mapped technical file (only the workflow's
19
- universal `ai-rules.md` seed + `constitution.technical.md`, referred to directly).
20
- - `## /aw-spec-specify` is the one **modelling-methodology** slot (see the rule partition):
21
- a domain-agnostic way of *modelling*, never a technology choice. Everything below it is a
22
- HOW-phase technical set.
23
-
24
- ---
25
-
26
- ## /aw-spec-specify
27
- <!-- MODELLING METHODOLOGY ONLY. Specify is the domain phase: the single technical input it
28
- may take is a domain-agnostic way of MODELLING (DDD tactical patterns), never a
29
- technology choice. Do NOT add an architecture / persistence / codegen file here — that
30
- would break specify's domain purity (design/implement own those). The domain's own DDD
31
- overlay (domain-driven-design.domain.md) arrives separately via comandrulemap. -->
32
- - docs/domain/domain-driven-design.md
33
-
34
- ## /aw-spec-design
35
- <!-- The technical/architecture rule files the design author works from (alongside the
36
- spec and constitution.technical.md). NO domain file here — domain reaches design
37
- only as spec ids (BR-/CN-/DC-/IC-). -->
38
- - docs/architecture/clean-architecture.md
39
- - docs/architecture/cqrs.md
40
- - docs/architecture/eventing.md
41
- - docs/architecture/modular-monolith.md
42
- - docs/architecture/vertical-slices.md
43
- - docs/architecture/persistence.md
44
- - docs/architecture/folder-structure.md
45
- - docs/architecture/testing.md
46
- - docs/governance/api-versioning.md
47
- - docs/security/zero-trust.md
48
- - docs/security/authorization.md
49
- - docs/security/authorization-matrix.md
50
- - docs/security/auditing.md
51
- - docs/security/data-classification.md
52
- - docs/interop/ihe-conformance.md
53
-
54
- ## /aw-spec-implement
55
- <!-- The FRAMEWORK / code-generation rule files the code generator builds against
56
- (alongside design.md and constitution.technical.md). NO domain file — domain
57
- reaches implement only through design.md. clean-architecture/cqrs are design
58
- concerns; component wiring is a separate /aw-spec-orch add-component step. -->
59
- - docs/governance/coding-standards.md
60
- - docs/governance/dependency-policy.md
61
- - docs/architecture/folder-structure.md
62
- - docs/architecture/testing.md
63
- - docs/VerticalSlice/PACKAGING.md
64
-
65
- ## /aw-spec-implement-delta
66
- <!-- The CR analog of implement — same FRAMEWORK / code-generation set (HOW to build).
67
- The delta's code is generated against the master design.md + delta-design.md; no
68
- domain file (domain reached the delta via delta-spec → delta-design). -->
69
- - docs/governance/coding-standards.md
70
- - docs/governance/dependency-policy.md
71
- - docs/architecture/folder-structure.md
72
- - docs/architecture/testing.md
73
- - docs/VerticalSlice/PACKAGING.md
74
-
75
- ## /aw-spec-build
76
- <!-- The compile/fix reference set: the layering + coding rules the fixer respects when
77
- repairing compile errors against the design intent. NO domain file (build loads
78
- domain rules separately via domain-select) and no constitution.technical here. -->
79
- - docs/architecture/clean-architecture.md
80
- - docs/governance/coding-standards.md
81
-
82
- ## /aw-spec-analyze-slice
83
- <!-- The design↔code conformance gate's TECHNICAL checklist: the code + tests are
84
- validated against these (alongside the DOMAIN gate overlays, loaded separately via
85
- resolve-domain `## /aw-spec-gate`). Validation input only — never authoring. -->
86
- - docs/architecture/testing.md
87
- - docs/governance/coding-standards.md
88
-
89
- ## /aw-spec-constitution
90
- <!-- The technology-constitution base the TECHNICAL half of the split constitution
91
- ratifies into constitution.technical.md. Loaded BEFORE the technical half and before
92
- domain-select, so the technical author stays domain-free (the seam). NO domain file
93
- here — the domain half's sources are the domain map's ## /aw-spec-constitution. -->
94
- - docs/technology-constitution.md
95
-
96
- ## /aw-spec-run
97
- <!-- Execution / data migration: the persistence rules the migration step generates against.
98
- NO domain file; run does not reference constitution.technical.md. -->
99
- - docs/architecture/persistence.md
100
-
101
- ---
102
-
103
- ## Quick reference (command → technical file count)
104
-
105
- | Command | Technical rule files | Role |
106
- |---|---|---|
107
- | /aw-spec-specify | 1 | the modelling methodology (DDD) the domain model is expressed in — no technology |
108
- | /aw-spec-design | 15 | architecture/security/interop the design author mediates the spec against |
109
- | /aw-spec-implement | 5 | governance/architecture the code generator builds against (from design.md) |
110
- | /aw-spec-implement-delta | 5 | same code-generation set, scoped to the open change's delta-design |
111
- | /aw-spec-build | 2 | layering + coding rules the compile-fixer respects |
112
- | /aw-spec-analyze-slice | 2 | testing + coding rules the design↔code gate validates against |
113
- | /aw-spec-constitution | 1 | the technology-constitution base the technical half ratifies |
114
- | /aw-spec-run | 1 | persistence rules the execution / data-migration step generates against |
115
-
116
- > All migrated workflows are on this map. The conformance-gate workflows **analyze-design**
117
- > and **analyze-delta-design** are intentionally NOT here — they validate design/delta
118
- > against the spec + DOMAIN gate overlays only (comandrulemap `## /aw-spec-gate`), with no
119
- > technical gate checklist.
@@ -1,19 +0,0 @@
1
- # Consent Standards
2
-
3
- > NON-NEGOTIABLE. Commands: `/aw-spec-constitution`, `/aw-spec-specify`.
4
-
5
- ## First-class aggregate
6
- - Consent is a **first-class aggregate** (Patients module). A **withdrawn consent MUST block downstream PHI disclosure** for the purpose-of-use **immediately**; state changes emit `ConsentChangedEvent` (see [[eventing]]).
7
- - The access-control pipeline **MUST check consent before releasing PHI** outside the treating-provider context. Denial surfaces as `ConsentDeniedException` from the Domain (see [[domain-driven-design.domain]], [[authorization.domain]]).
8
-
9
- ## Break-the-glass
10
- - Explicit **emergency-access command**: documented reason + high-priority audit + real-time alert; audit-mandatory (see [[auditing.domain]]).
11
-
12
- ## Restriction-of-processing
13
- - GDPR restriction (Art. 18) + erasure (Art. 17) are first-class audited commands. Where law forbids erasing medical records, **restriction-of-processing is the fallback** (see [[hipaa]], [[persistence.domain]]).
14
-
15
- ## FHIR mapping
16
- - **BPPC** + **FHIR Consent** profiles honored; Consent projects to the FHIR `Consent` resource (see [[fhir]]).
17
-
18
- ## Related
19
- - [[hipaa]] · [[authorization.domain]] · [[auditing.domain]] · [[fhir]] · [[domain-driven-design.domain]]
@@ -1,12 +0,0 @@
1
- # CQRS — Healthcare Domain Addenda
2
-
3
- > Technology base: [[cqrs]]. Commands: `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- ## Pipeline
6
- - Append a **PHI-access-audit behavior** to the mediator pipeline (beyond generic logging + FluentValidation): emit an audit record for every command/query touching PHI (see [[auditing.domain]]).
7
-
8
- ## Error codes
9
- Dot-namespaced slugs (see [[cqrs]]). Examples: `patient.not_found` · `claim.duplicate_submission` · `consent.denied` · `concurrency.conflict`.
10
-
11
- ## Related
12
- - [[cqrs]] · [[auditing.domain]] · [[hipaa]] · [[domain-driven-design.domain]]
@@ -1,28 +0,0 @@
1
- # Data Classification — Healthcare Domain Addenda
2
-
3
- > Technology base: [[data-classification]]. NON-NEGOTIABLE. Commands: `/aw-spec-constitution`, `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- ## Categories
6
- | Class | Extra rules |
7
- |---|---|
8
- | **PHI** (clinical, demographic, identifiers) | Minimum-necessary; audited; encrypted |
9
- | **PII** (non-clinical identifiers) | Encrypted; minimum-necessary |
10
- | **PCI** (payment) | **Out of scope** — route to a PCI-DSS processor |
11
- | **Behavioral Health** (42 CFR Part 2) | Extra-sensitive; field-level encryption |
12
- | **Genetic** (GINA) | Extra-sensitive |
13
- | **Pediatric** (minors) | Extended retention; heightened protection |
14
-
15
- ## Field-level encryption (required)
16
- SSN, government IDs, payment-card data, behavioral-health flags (see [[hipaa]], [[persistence.domain]]).
17
-
18
- ## Logging
19
- - **NEVER** log/emit any PHI element, full SSN, government ID, or full payment-card data.
20
- - PHI-logging analyzer (CI gate): no Patient/Encounter/Observation/MedicationRequest field logged except the ID (see [[coding-standards.domain]]).
21
-
22
- ## Export
23
- - Analytics/research/non-prod exports MUST pass **Safe-Harbor or Expert-Determination** de-identification.
24
- - **Production PHI in non-production is FORBIDDEN** (see [[hipaa]], [[testing.domain]]).
25
- - Bulk `$export` gated by authorization + de-identification (see [[fhir]]).
26
-
27
- ## Related
28
- - [[data-classification]] · [[hipaa]] · [[auditing.domain]] · [[authorization.domain]] · [[persistence.domain]] · [[coding-standards.domain]]
@@ -1,11 +0,0 @@
1
- # Dependency Policy — Healthcare Domain Addenda
2
-
3
- > Technology base: [[dependency-policy]]. Commands: `/aw-spec-gate`.
4
-
5
- ## Reviews & libraries
6
- - Every new dependency gets a **HIPAA-suitability** review beyond the generic license/supply-chain check — e.g. reject a logging package that ships analytics by default (PHI-exfiltration risk) (see [[hipaa]], [[data-classification.domain]]).
7
- - FHIR: the **official FHIR .NET SDK**, version-matched to the endpoint (R4/R5; see [[fhir]]).
8
- - HL7 v2 / DICOM libraries are added **only** on explicit developer request — no AI-introduced healthcare-protocol dependencies (see [[hl7]], [[dicom]], [[ai-rules.domain]]).
9
-
10
- ## Related
11
- - [[dependency-policy]] · [[fhir]] · [[hl7]] · [[dicom]] · [[hipaa]] · [[ai-rules.domain]]
@@ -1,15 +0,0 @@
1
- # DICOM Standards
2
-
3
- > Commands: `/aw-spec-constitution`, `/aw-spec-specify`.
4
-
5
- ## DICOMweb façade
6
- - Supported via a **DICOMweb façade** — **QIDO-RS** (query), **WADO-RS** (retrieve), **STOW-RS** (store) — fronting a separately deployed PACS/VNA. Adapters live in `{Module}/Interop/Dicom/` (Radiology only).
7
- - The PACS/VNA endpoint is an Aspire resource referenced via `.WithReference(...)`; hosts/ports discovered through Aspire, never hard-coded.
8
-
9
- ## Metadata only
10
- - **Only DICOM METADATA is persisted here** — pixel data lives in the PACS/VNA, referenced by study/series/instance UIDs.
11
- - Radiology aggregates: `ImagingOrder`, `ImagingStudy` (metadata), `DiagnosticReport`; results surface via FHIR projections (`ImagingStudy`, `DiagnosticReport`; see [[fhir]]).
12
- - Trace context propagates across DICOM outbound calls (see [[auditing]]).
13
-
14
- ## Related
15
- - [[fhir]] · [[integration-terms]] · [[domain-driven-design]]
@@ -1,28 +0,0 @@
1
- # Domain-Driven Design — Healthcare Domain Model
2
-
3
- > Technology base: [[domain-driven-design]]. NON-NEGOTIABLE. Commands: `/aw-spec-specify`.
4
-
5
- ## Modeling
6
- - Use the clinical/interop ubiquitous language (see [[clinical-terms]], [[integration-terms]]).
7
- - FHIR-aligned, but **FHIR resources are projections, not the system of record** (see [[fhir]]).
8
- - Coded concepts use industry terminologies, never free text (see [[terminology]]); coded value objects follow the FHIR pattern (`Codeable`, `Coding`, `Quantity`, `Period`, `Range`, `Ratio`, `Identifier`, `HumanName`, `Address`, `ContactPoint`).
9
- - Domain may throw `ConsentDeniedException` beyond generic Domain exceptions (see [[consent]]).
10
-
11
- ## Aggregates & invariants
12
- - **Patient** — MRN unique per tenant; DOB <= today; merge only via `MergePatientsCommand` preserving audit; minimum-necessary projection by role/scope.
13
- - **Consent** — withdrawal blocks downstream PHI disclosure for the purpose-of-use immediately; emits `ConsentChangedEvent` (see [[consent]]).
14
- - **Appointment** — no overlap with a booked slot for the same Practitioner/Resource; no past booking; late cancellation (< N hrs) emits `LateCancellationEvent`.
15
- - **Encounter** — not Closed/Discharged while any open Order/Result/ChargeItem/unsigned ClinicalNote exists; admission requires active Coverage or documented self-pay.
16
- - **ClinicalNote** — Signed = immutable; addendum is a new linked note; deletion forbidden (supersede via Amend).
17
- - **MedicationRequest** — dispense forbidden on active allergy match, lethal interaction, or pediatric/renal contraindication without a documented override (prescriber, reason, timestamp).
18
- - **ControlledSubstanceLedger** — every dispense/waste must balance; append-only; daily reconciliation.
19
- - **LabOrder/ImagingOrder** — not Cancellable once a Specimen/Image is acquired; transition to Aborted with a reason.
20
- - **Claim** — total billed = sum(ChargeItem.amount); resubmission needs a new ClaimVersion; none after final adjudication unless an Appeal is opened.
21
- - **InventoryItem** — stock <= 0 forbidden; dispensing an expired Lot rejected; near-expiry emits `ExpiryAlertEvent`.
22
- - **AuditRecord** — append-only; no update/delete; retention >= 6 years (see [[auditing.domain]]).
23
-
24
- ## AI guidance
25
- See [[ai-rules.domain]] — confirm signatures, use the official FHIR SDK, never invent codes, mask PHI.
26
-
27
- ## Related
28
- - [[domain-driven-design]] · [[fhir]] · [[terminology]] · [[consent]] · [[clinical-terms]] · [[integration-terms]] · [[auditing.domain]] · [[persistence.domain]] · [[ai-rules.domain]]
@@ -1,55 +0,0 @@
1
- # DOMAIN REQUIREMENTS (project-specific)
2
-
3
- > Project-specific input, **updated independently per project**. The engineering constitution
4
- > (the technology base composed with `healthcare-constitution.md`) references this file; the
5
- > constitution stays domain-agnostic and supreme. Detailed domain *rules* are expanded in
6
- > `docs/` — this file holds the
7
- > per-project enumeration and headline profiles.
8
- >
9
- > Replace `<SampleProjectName>` and the bounded-context list below for a new project.
10
-
11
- =====================================================================
12
- [DOMAIN: Bounded Contexts / Modules]
13
- =====================================================================
14
- - Patients — aggregates: Patient (master patient index), Consent, RelatedPerson; cross-references via PIX/PDQ.
15
- - Appointments — aggregates: Appointment, Slot, Schedule, Waitlist.
16
- - Encounters — aggregates: Encounter (inpatient, outpatient, emergency), Admission, Transfer, Discharge.
17
- - EMR — aggregates: ClinicalNote, ProblemList, AllergyIntolerance, MedicationStatement, Observation (vitals, social history), Immunization, CarePlan, ServiceRequest, Procedure.
18
- - Radiology — aggregates: ImagingOrder, ImagingStudy (DICOM metadata), DiagnosticReport (radiology); pixel data lives in PACS/VNA.
19
- - Lab — aggregates: LabOrder, Specimen, Observation (lab result), DiagnosticReport (lab).
20
- - Pharmacy — aggregates: MedicationRequest, MedicationDispense, MedicationAdministration, Formulary, ControlledSubstanceLedger.
21
- - Billing — aggregates: ChargeItem, Invoice, Claim, ClaimResponse, PaymentReconciliation, Account, AdjustmentEntry.
22
- - Insurance — aggregates: Coverage, Payer, Plan, EligibilityRequest, EligibilityResponse, PriorAuth.
23
- - Inventory — aggregates: InventoryItem, Lot, StockMovement, Reservation, ExpiryAlert.
24
- - Interoperability — aggregates: IntegrationEndpoint, MessageEnvelope (HL7v2), FhirSubscription, BulkExportJob.
25
- - PatientPortal — aggregates: PortalAccount (identity-bound), MessageThread, AppointmentRequest, RecordAccessRequest.
26
- - Identity — aggregates: Practitioner, PractitionerRole, Organization, Location, HealthcareService.
27
- - Auditing — aggregates: AuditRecord (append-only, ATNA + FHIR AuditEvent shape).
28
- - Terminology — aggregates: CodeSystem, ValueSet, ConceptMap (project-managed subsets; expansions cached from external TS).
29
-
30
- =====================================================================
31
- [DOMAIN: subsection pointers]
32
- =====================================================================
33
- [DOMAIN: Aggregates and Business Invariants] -> docs/domainspecs/healthcare/domain-driven-design.domain.md
34
- [DOMAIN: Persistence Profile] -> docs/domainspecs/healthcare/persistence.domain.md
35
- [DOMAIN: Security Profile] -> docs/domainspecs/healthcare/authorization.domain.md, docs/domainspecs/healthcare/data-classification.domain.md
36
- [DOMAIN: Testing Profile] -> docs/domainspecs/healthcare/testing.domain.md
37
- [DOMAIN: AI Policy Addenda] -> docs/domainspecs/healthcare/ai-rules.domain.md
38
- [DOMAIN: Platform Topology] -> below
39
-
40
- =====================================================================
41
- [DOMAIN: Platform Topology]
42
- =====================================================================
43
- - Target runtime: Kubernetes (AKS, EKS, or on-prem). Single-region by default; multi-region active/passive for DR.
44
- - External dependencies (Aspire resources): PostgreSQL (primary), Redis (cache + portal session), a message broker (Azure Service Bus, AWS SQS/SNS, or RabbitMQ) for CloudEvents, an OTel collector, the configured IdP, an external Terminology Service (optional), a FHIR validator container, a PACS/VNA endpoint (DICOMweb), an HL7v2 broker (MLLP), an SMTP/SMS gateway, an object store (S3/Blob) for binaries.
45
- - Scale targets: P95 read latency < 200 ms at 200 RPS per module; FHIR search P95 < 500 ms; HL7v2 ingest sustains 50 messages/sec per channel.
46
- - Disaster recovery: RPO <= 15 minutes, RTO <= 4 hours; daily encrypted backups with 35-day retention plus monthly archive >= 7 years.
47
-
48
- =====================================================================
49
- [DOMAIN: Governance Overrides]
50
- =====================================================================
51
- - Principal Engineers (approvers): TBD — fill at ratification.
52
- - Security/Compliance Officer (mandatory approver for any PHI/security change): TBD.
53
- - Domain Owners (per module): TBD — assign one clinical and one technical owner per bounded context.
54
- - Quarterly review cadence: first business week of each quarter; security review additionally after every significant regulatory update.
55
- - Exception process: a time-boxed waiver via a Waiver Request issue, approved by a Principal Engineer + the Compliance Officer, with a mandatory expiry <= 90 days and a remediation plan recorded in the issue.
@@ -1,18 +0,0 @@
1
- # Eventing — Healthcare Domain Addenda
2
-
3
- > Technology base: [[eventing]]. Commands: `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- ## Inbound feeds
6
- Each translated to internal commands via Interop adapters — never writing aggregates directly (see [[eventing]]):
7
- - HL7 v2 (ADT/ORM/ORU/SIU/MDM/DFT) — see [[hl7]]
8
- - External EHR FHIR pulls — see [[fhir]]
9
- - Lab / radiology result feeds; claim adjudication responses
10
-
11
- ## Trace propagation
12
- - Trace context MUST propagate across **HL7v2 / DICOM / FHIR** outbound calls (beyond generic mediator/`HttpClient`/EF Core propagation).
13
-
14
- ## Single source of truth
15
- - Authoritative system of record; consumers use FHIR / REST / CloudEvents / Bulk `$export` — **direct DB access FORBIDDEN** (see [[hipaa]]).
16
-
17
- ## Related
18
- - [[eventing]] · [[hl7]] · [[fhir]] · [[dicom]] · [[hipaa]]
@@ -1,36 +0,0 @@
1
- # FHIR Standards
2
-
3
- > NON-NEGOTIABLE. Commands: `/aw-spec-constitution`, `/aw-spec-specify`.
4
-
5
- ## Architecture
6
- - **R4 is the default external contract**; R5 is **additive** under `/fhir/R5/...`.
7
- - FHIR is the canonical interop contract; internal REST is for first-party apps. Both serve from the **same authoritative aggregates** — no duplicate write paths.
8
-
9
- ## Projector rules (system of record)
10
- - **FHIR resources are PROJECTIONS over the aggregates — NOT the system of record.**
11
- - Mapping lives in `{Module}/Interop/Fhir/<Resource>Projector.cs`, hand-written + round-trip tested (`domain -> FHIR -> domain`; see [[testing]]).
12
- - A second FHIR write path bypassing the aggregate is FORBIDDEN; FHIR representations **MUST NOT** replace internal DTOs (see [[vertical-slices]]).
13
-
14
- ## Resources & terminology
15
- - FHIR types come from the **official FHIR .NET SDK**, version-matched (R4/R5) to the endpoint.
16
- - Coded fields map from `Codeable`/`Coding` VOs to FHIR `CodeableConcept`/`Coding` (see [[terminology]]).
17
-
18
- ## Profiles & CapabilityStatement
19
- - Honor **US Core** + project IGs; declare profiles/extensions/value-sets/search-params in `StructureDefinition` resources packaged with the service.
20
- - Publish `CapabilityStatement` at `/fhir/metadata` (regenerates cleanly in CI; diff reviewed); `/metadata` + `/.well-known` may be `AllowAnonymous()`.
21
- - Breaking changes require a **new version path** + published CapabilityStatement diff (see [[api-versioning.domain]]); FHIR validator passes for every modified resource/profile/example (CI gate).
22
-
23
- ## Bundle / search / concurrency
24
- - List endpoints use **Bundle/searchset** semantics (`_count`, `_offset`/`_page`, `_total`).
25
- - Errors use `OperationOutcome` (HTTP 422 for validation).
26
- - `If-Match` honored via the aggregate's concurrency token → FHIR **weak** ETag at the projection boundary (see [[persistence]]).
27
-
28
- ## SMART & Bulk Data
29
- - SMART app launch (EHR + standalone) MUST be supported — **PKCE mandatory; implicit flow forbidden**; scopes enforced on every endpoint (see [[authorization.domain]]).
30
- - **Bulk `$export`** supported for authorized backend extraction; de-identification required for analytics/research (see [[hipaa]]).
31
-
32
- ## IHE
33
- - PIX/PDQ, XDS/XDS.b or MHD, ATNA, CT, BPPC followed where they apply; deviations in `docs/interop/ihe-conformance.md` (see [[integration-terms]], [[auditing.domain]]).
34
-
35
- ## Related
36
- - [[domain-driven-design.domain]] · [[terminology]] · [[hl7]] · [[dicom]] · [[consent]] · [[authorization.domain]] · [[api-versioning.domain]] · [[testing.domain]]
@@ -1,23 +0,0 @@
1
- # Folder Structure — Healthcare Domain Addenda
2
-
3
- > Technology base: [[folder-structure]]. Commands: `/aw-spec-gate`. Replace `<SampleProjectName>`.
4
-
5
- ## Additions to the base layout
6
- ```
7
- src/<SampleProjectName>.Service/
8
- Infrastructure/Security/ auth handlers, scope evaluators, PHI-access pipeline
9
- Infrastructure/Auditing/ ATNA + FHIR AuditEvent emitter
10
- <Module>/Domain/<ValueObject>.cs coded VOs: Codeable, Coding, Quantity, HumanName, ...
11
- <Module>/Interop/Fhir/ projectors, search-param handlers, IG profiles (see [[fhir]])
12
- <Module>/Interop/Hl7v2/ inbound parsers + outbound emitters (see [[hl7]])
13
- <Module>/Interop/Dicom/ DICOMweb adapters (Radiology only) (see [[dicom]])
14
- tests/<SampleProjectName>.InteropTests/ FHIR-validator conformance (see [[testing.domain]])
15
- tests/<SampleProjectName>.TestFixtures/ synthetic-PHI + terminology sentinels (see [[testing.domain]])
16
- docs/interop/ihe-conformance.md · docs/interop/fhir-implementation-guide/
17
- docs/security/hipaa-controls.md · docs/security/gdpr-controls.md
18
- ```
19
- - `Interop/` adapters translate to/from internal commands + projections (see [[vertical-slices.domain]]).
20
- - Coded value objects follow the FHIR pattern (see [[terminology]], [[coding-standards.domain]]).
21
-
22
- ## Related
23
- - [[folder-structure]] · [[fhir]] · [[hl7]] · [[dicom]] · [[testing.domain]] · [[vertical-slices.domain]]
@@ -1,34 +0,0 @@
1
- # HIPAA / PHI Protection Standards
2
-
3
- > NON-NEGOTIABLE. Commands: `/aw-spec-constitution`, `/aw-spec-specify`.
4
-
5
- ## Regime
6
- PHI/ePHI under **HIPAA** (Privacy + Security + Breach Notification), **HITECH**, **21st Century Cures Act** anti-information-blocking, and **GDPR** where EU subjects apply, plus regional rules.
7
-
8
- ## Minimum necessary
9
- - Every PHI read/write endpoint enforces **minimum-necessary** — return only fields the caller's role + SMART scopes authorize.
10
- - Field-level redaction lives in **projection extensions**, not controllers (see [[fhir]], [[authorization.domain]]).
11
-
12
- ## Audit & consent
13
- - Every PHI read/mutation, authentication, consent change, export, and break-the-glass MUST emit an immutable audit record (see [[auditing.domain]]).
14
- - Consent is a first-class aggregate; the pipeline checks it before releasing PHI outside the treating-provider context (see [[consent]]).
15
-
16
- ## Encryption
17
- - **AES-256 at rest** (TDE + CMK), **TLS 1.2+** in transit (1.3 target), encrypted backups.
18
- - App-level field encryption for SSN, government IDs, payment-card data, behavioral-health flags (see [[data-classification.domain]]).
19
-
20
- ## De-identification
21
- - Exports to analytics/research/non-prod MUST pass a **Safe-Harbor OR Expert-Determination** service.
22
- - **Production PHI in dev/test/demo/CI is FORBIDDEN** — use synthetic-PHI fixtures (see [[testing.domain]]). De-identification without a documented method is a refusal condition (see [[ai-rules.domain]]).
23
-
24
- ## Retention & rights
25
- - `AuditRecord` >= 6 yrs; clinical per jurisdiction (US >= 6 yrs adult, longer for minors); financial >= 7 yrs; backups under the same CMK (see [[persistence.domain]]).
26
- - Access, amendment, restriction, accounting-of-disclosures, erasure (GDPR Art. 17) are first-class commands with their own audit; where law forbids erasing medical records, **restriction-of-processing** is the fallback (see [[consent]]).
27
-
28
- ## Breach, BAA, SSoT
29
- - Anomalous access (volume spikes, off-hours mass reads, repeated denials) emits **Critical** alerts.
30
- - Any outbound integration transmitting PHI is gated by a **BAA flag**; absence MUST refuse the integration at startup.
31
- - Authoritative system of record; consumers use FHIR / REST / CloudEvents / Bulk `$export` — **direct DB access FORBIDDEN** (see [[eventing]]).
32
-
33
- ## Related
34
- - [[auditing.domain]] · [[consent]] · [[data-classification.domain]] · [[authorization.domain]] · [[zero-trust.domain]] · [[persistence.domain]] · [[testing.domain]] · [[ai-rules.domain]]
@@ -1,15 +0,0 @@
1
- # HL7 v2 Standards
2
-
3
- > Commands: `/aw-spec-constitution`, `/aw-spec-specify`.
4
-
5
- ## Adapters (not a parallel model)
6
- - HL7 v2.x (**ADT, ORM, ORU, SIU, MDM, DFT**) MUST be supported via an **ingress adapter** → internal commands; an **egress adapter** converts domain events → outbound messages.
7
- - Adapters live in `{Module}/Interop/Hl7v2/`; translate via `IMediator` — **MUST NOT** write aggregates directly (see [[eventing]], [[domain-driven-design]]). Bypassing them from an external feed is an AI refusal condition (see [[ai-rules.domain]]).
8
- - Conformance tested against an **internal corpus** (see [[testing]]).
9
-
10
- ## MLLP
11
- - The HL7v2 broker (MLLP) is an Aspire resource referenced via `.WithReference(...)`; hosts/ports discovered through Aspire, never hard-coded.
12
- - Ingest target: **50 messages/sec per channel**; trace context propagates across HL7v2 outbound calls (see [[auditing]]).
13
-
14
- ## Related
15
- - [[fhir]] · [[eventing]] · [[integration-terms]] · [[domain-driven-design]] · [[testing]]
@@ -1,21 +0,0 @@
1
- # Glossary — Integration Terms
2
-
3
- > Ubiquitous language for interoperability standards + IHE profiles. Commands: `/aw-spec-specify`.
4
-
5
- | Term | Definition |
6
- |---|---|
7
- | **HL7** | **HL7 v2.x** = legacy pipe-delimited messaging (ADT/ORM/ORU/SIU/MDM/DFT) via adapters (see [[hl7]]); **HL7 FHIR** = the resource-based standard (see [[fhir]]). |
8
- | **FHIR** | Canonical external contract (R4 default, R5 additive); resources are projections over aggregates (see [[fhir]]). |
9
- | **DICOM** | Imaging standard via DICOMweb (QIDO/WADO/STOW-RS); only metadata persisted here (see [[dicom]]). |
10
- | **PIX / PDQ** | Patient Identifier Cross-referencing / Demographics Query (IHE) — used by Patients. |
11
- | **ATNA** | Audit Trail + Node Authentication (IHE); audit records exportable as FHIR `AuditEvent` (see [[auditing.domain]]). |
12
- | **MHD / XDS / XDS.b** | Document-sharing profiles (IHE); MHD is the FHIR-based lightweight alternative to XDS. |
13
- | **CT** | Consistent Time (IHE) — synchronized clocks across nodes. |
14
- | **BPPC** | Basic Patient Privacy Consents (IHE consent profile; see [[consent]]). |
15
- | **SMART on FHIR** | OAuth2/OIDC app-launch for third-party apps; PKCE mandatory (see [[authorization.domain]]). |
16
- | **Bulk Data / `$export`** | FHIR Bulk Data spec for population-level extraction; de-identified for analytics (see [[hipaa]]). |
17
- | **CloudEvents** | CNCF durable async event-stream spec over the broker (see [[eventing]]). |
18
- | **OpenAPI / CapabilityStatement / AsyncAPI** | Versioned machine-readable contracts for REST / FHIR / events (see [[api-versioning]]). |
19
-
20
- ## Related
21
- - [[clinical-terms]] · [[fhir]] · [[hl7]] · [[dicom]] · [[eventing.domain]] · [[auditing.domain]] · [[authorization.domain]] · [[api-versioning.domain]]
@@ -1,20 +0,0 @@
1
- # Persistence — Healthcare Domain Addenda
2
-
3
- > Technology base: [[persistence]]. Commands: `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- ## Soft delete & retention
6
- - Hard delete FORBIDDEN for any aggregate holding **clinical/financial/PHI** data — delete logically via `MarkAsDeleted(...)`. All aggregates are soft-deleted (no exemptions).
7
- - `AuditRecord` is **append-only** — no delete (see [[auditing.domain]]).
8
- - Retention: `AuditRecord` >= 6 years; clinical per jurisdiction (US >= 6 yrs adult, longer for minors); financial >= 7 years; backups under the same CMK.
9
- - GDPR Art. 17 erasure → **restriction-of-processing** where law forbids erasing medical records (see [[consent]], [[hipaa]]).
10
-
11
- ## Encryption
12
- - Production PostgreSQL: **TDE with customer-managed keys (CMK)**.
13
- - App-level field encryption for SSN, government IDs, payment-card data, behavioral-health flags (see [[data-classification.domain]], [[hipaa]]).
14
-
15
- ## Tenancy & dev data
16
- - Multi-hospital deployments MAY opt into tenant-per-database; default tenant-per-row.
17
- - SQLite dev fixtures contain **no PHI** — production PHI in dev/test/CI is FORBIDDEN (see [[hipaa]]).
18
-
19
- ## Related
20
- - [[persistence]] · [[hipaa]] · [[auditing.domain]] · [[data-classification.domain]] · [[consent]]
@@ -1,30 +0,0 @@
1
- # Terminology Standards
2
-
3
- > NON-NEGOTIABLE. Commands: `/aw-spec-constitution`, `/aw-spec-specify`.
4
-
5
- ## Coded value objects
6
- - **Coded data MUST use industry terminologies — free-text strings for coded concepts are FORBIDDEN.**
7
- - Every code-bearing field is a **`Codeable` value object** `{ system, code, version, display }` (mirrors FHIR `CodeableConcept`/`Coding`) — store code, code-system OID/URI, version, display.
8
-
9
- ## Standard terminologies
10
- | Domain | Terminology |
11
- |---|---|
12
- | Diagnoses | ICD-10-CM (US) / ICD-10 (WHO); ICD-11 where required |
13
- | Procedures (billing / clinical / inpatient) | CPT, HCPCS Level II / SNOMED CT / ICD-10-PCS |
14
- | Lab observations / document types | LOINC |
15
- | Clinical concepts (problems, findings, body sites, allergies) | SNOMED CT |
16
- | Medications | RxNorm (US); NDC (dispense identity); ATC (analytics) |
17
- | Units of measure | UCUM |
18
- | Vaccines | CVX (CDC); MVX (manufacturers) |
19
-
20
- ## Validation
21
- - Hard-coded coded literals FORBIDDEN outside the Terminology module's seed data.
22
- - Never invent ICD/SNOMED/LOINC/CPT/HCPCS/RxNorm/CVX codes — confirm against the module's value sets (see [[ai-rules.domain]]).
23
- - Free-text storage where a coded vocabulary applies is a Forbidden Pattern.
24
-
25
- ## Terminology module
26
- - Lookup/validation/expansion **MUST** go through a dedicated **Terminology module** (internal cache or external TS via FHIR `$expand` / `$validate-code`).
27
- - Aggregates: `CodeSystem`, `ValueSet`, `ConceptMap` (project-managed subsets; expansions cached).
28
-
29
- ## Related
30
- - [[fhir]] · [[domain-driven-design.domain]] · [[clinical-terms]] · [[testing.domain]] · [[ai-rules.domain]]
@@ -1,15 +0,0 @@
1
- # Testing — Healthcare Domain Addenda
2
-
3
- > Technology base: [[testing]]. Commands: `/aw-spec-gate`.
4
-
5
- ## FHIR & interop tests
6
- - FHIR endpoints MUST validate against the official **FHIR validator** + project IGs; profile changes ship with test updates in the **same commit** (see [[fhir]]).
7
- - FHIR projectors MUST have a round-trip test (`domain -> FHIR -> domain`).
8
- - Contract tests: FHIR validator + Inferno (or equiv) for US Core/the IG; HL7 v2 conformance against an internal corpus (see [[hl7]]); CloudEvents schema validation by every consumer harness (see [[eventing.domain]]).
9
-
10
- ## Test data
11
- - MUST use the synthetic-PHI fixture library (`<SampleProjectName>.TestFixtures`); **production PHI in dev/test/demo/CI is FORBIDDEN** (see [[hipaa]]).
12
- - Coded values use sentinel constants (e.g. `TerminologyFixtures.IcdSampleHypertension`) — never invented ICD/SNOMED/LOINC/CPT codes (see [[terminology]], [[ai-rules.domain]]).
13
-
14
- ## Related
15
- - [[testing]] · [[fhir]] · [[hl7]] · [[terminology]] · [[hipaa]] · [[ai-rules.domain]]
@@ -1,18 +0,0 @@
1
- # Vertical Slices — Healthcare Domain Addenda
2
-
3
- > Technology base: [[vertical-slices]]. Commands: `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- ## Interop adapters in the slice
6
- `{Module}/Interop/` carries the external-protocol adapters:
7
- ```
8
- Fhir/ projectors, search-param handlers, IG profiles (see [[fhir]])
9
- Hl7v2/ inbound parsers + outbound emitters (see [[hl7]])
10
- Dicom/ DICOMweb adapters (Radiology only) (see [[dicom]])
11
- ```
12
-
13
- ## Rules
14
- - FHIR resources live in a **parallel projection layer** and **MUST NOT** replace internal `Shared` DTOs (see [[fhir]]).
15
- - Domain DTOs (`PatientDto`, `EncounterDto`) — no setters, required `init`, base64 `RowVersionBase64`.
16
-
17
- ## Related
18
- - [[vertical-slices]] · [[fhir]] · [[hl7]] · [[dicom]]
@@ -1,12 +0,0 @@
1
- # Zero-Trust — Healthcare Domain Addenda
2
-
3
- > Technology base: [[zero-trust]]. Commands: `/aw-spec-constitution`, `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- ## Rules
6
- - **PHI in transit MUST be TLS-encrypted**; at-rest encryption: see [[hipaa]], [[data-classification.domain]].
7
- - External IdP MUST be SMART-on-FHIR-capable; tokens/scopes enforced on every FHIR endpoint and propagated through the pipeline (see [[authorization.domain]], [[fhir]]).
8
- - IHE **ATNA** node authentication applies to inter-node communication (see [[auditing.domain]]).
9
- - Trace context MUST propagate across outbound **HL7v2 / DICOM / FHIR** calls (see [[eventing.domain]]).
10
-
11
- ## Related
12
- - [[zero-trust]] · [[authorization.domain]] · [[auditing.domain]] · [[hipaa]] · [[fhir]]
@@ -1,32 +0,0 @@
1
- # AI Operational Rules — Pharma Domain Addenda
2
-
3
- > Technology base: [[ai-rules]]. Commands: **ALL**.
4
-
5
- ## Context & codes
6
- - FHIR types: use the **official FHIR .NET SDK**, version-matched (R4/R5) to the endpoint (see [[fhir]]).
7
- - Confirm coded values against the Terminology module's value sets; never invent NDC/UNII/RxNorm/SNOMED/ATC/UCUM codes (see [[terminology]], [[ndc]], [[atc]]).
8
- - Align aggregates to ISO IDMP concept boundaries, not ad-hoc shapes (see [[idmp]]).
9
-
10
- ## Generation
11
- - `MedicinalProduct` is the Aggregate Root. Generate `NdcCode`/`ProductName`/`GenericName`/`Strength`/`DosageForm`/`RouteOfAdministration`/`AtcCode`/`MarketingStatus`/`PackageIdentifier` as **value objects**, and `ActiveIngredient`/`PackagingConfiguration`/`MarketingAuthorization` as **entities** (see [[domain-driven-design.domain]]).
12
- - A complete slice adds (when applicable): FHIR projector + FHIR-validator test, audit emission, version snapshot (see [[fhir]], [[auditing.domain]], [[persistence.domain]], [[testing.domain]]).
13
- - FHIR resources are projections — never a second FHIR write path bypassing the aggregate (see [[fhir]]).
14
- - Comments are reserved for regulatory/domain intent (generic rule in [[ai-rules]]).
15
-
16
- ## Identifier & code safety
17
- - MUST NOT fabricate NDC values or Labeler Codes; MUST NOT invent ATC/UNII/RxNorm/SNOMED codes — use a sentinel constant (e.g. `TerminologyFixtures.AtcSample`) or the Terminology module (see [[testing.domain]], [[terminology]], [[ndc]], [[atc]]).
18
- - MUST attach a `ProvenanceRecord` on any external-import path (see [[data-provenance]]).
19
-
20
- ## Security- & compliance-touching code
21
- - MUST NOT modify audit emitters, version-history writers, lifecycle-transition guards, or identifier-uniqueness checks without an explicit reviewer-attached prompt (see [[auditing.domain]], [[persistence.domain]], [[product-lifecycle.domain]], [[ndc]]).
22
-
23
- ## Refusal conditions — extend [[ai-rules]]; refuse to:
24
- - Invent or hard-code NDC/ATC/UNII/RxNorm/SNOMED codes outside terminology seed data (see [[terminology]]).
25
- - Persist a product with an invalid NDC, invalid dosage form, invalid route, or unvalidated ATC code (see [[ndc]], [[terminology]], [[atc]]).
26
- - Hard-delete a `MedicinalProduct`, its history, or an `AuditRecord` (use lifecycle retirement / logical delete) (see [[persistence.domain]], [[auditing.domain]]).
27
- - Allow an invalid lifecycle transition or remove a transition guard (see [[product-lifecycle.domain]]).
28
- - Bypass Interop adapters by writing aggregates directly from an external feed (see [[hl7]], [[eventing.domain]]).
29
- - Suppress or weaken audit emission for create/modify/retire/identifier/classification changes (see [[auditing.domain]], [[regulatory-compliance]]).
30
-
31
- ## Related
32
- - [[ai-rules]] · [[domain-driven-design.domain]] · [[ndc]] · [[idmp]] · [[atc]] · [[terminology]] · [[fhir]] · [[auditing.domain]] · [[persistence.domain]] · [[product-lifecycle.domain]] · [[data-provenance]] · [[testing.domain]]
@@ -1,20 +0,0 @@
1
- # API Versioning — Pharma Domain Addenda (FHIR)
2
-
3
- > Technology base: [[api-versioning]]. Commands: `/aw-spec-specify`, `/aw-spec-gate`.
4
-
5
- ## FHIR versioning
6
- - R4 default; R5 **additive** under a versioned path (`/fhir/R5/...`).
7
- - Breaking changes to the Medication / MedicationKnowledge / Substance / Organization surface require a **new version path** + a published CapabilityStatement diff (see [[fhir]]).
8
- - FHIR list endpoints use Bundle/searchset semantics (`_count`, `_offset`/`_page`, `_total`).
9
-
10
- ## NDC identifier stability
11
- - `NdcCode` is a **stable identifier** — never silently rewritten. A correction is an explicit, audited identifier-change emitting `ProductIdentifierChanged`, preserved in version history (see [[ndc]], [[auditing.domain]], [[persistence.domain]], [[eventing.domain]]). ATC reclassification is likewise a versioned, audited event (see [[atc]]).
12
-
13
- ## Concurrency at the edge
14
- - FHIR resources honor `If-Match` via the aggregate's concurrency token → FHIR **weak** ETag at the projection boundary (see [[persistence.domain]]).
15
-
16
- ## CapabilityStatement
17
- - Published for FHIR (beyond generic OpenAPI); regenerates cleanly in CI; diff reviewed for breaking changes (see [[fhir]], [[coding-standards.domain]]).
18
-
19
- ## Related
20
- - [[api-versioning]] · [[fhir]] · [[ndc]] · [[atc]] · [[persistence.domain]] · [[eventing.domain]] · [[auditing.domain]] · [[coding-standards.domain]]