pharmaskills 0.6.0__py3-none-any.whl

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 (403) hide show
  1. pharmaskills/__init__.py +6 -0
  2. pharmaskills/__main__.py +4 -0
  3. pharmaskills/_meta.py +11 -0
  4. pharmaskills/_skills/adam-spec/SKILL.md +138 -0
  5. pharmaskills/_skills/adam-spec/references/adam-notes.md +20 -0
  6. pharmaskills/_skills/adam-spec/references/derivations.md +39 -0
  7. pharmaskills/_skills/adam-spec/references/spec-format.md +29 -0
  8. pharmaskills/_skills/adam-spec/scripts/run_adam.sh +14 -0
  9. pharmaskills/_skills/adam-spec/templates/adam-spec-notes.md +25 -0
  10. pharmaskills/_skills/adam-spec/templates/adam_spec.yaml +18 -0
  11. pharmaskills/_skills/adam-spec/templates/expected_values.yaml +13 -0
  12. pharmaskills/_skills/aggregate-report/SKILL.md +115 -0
  13. pharmaskills/_skills/aggregate-report/references/benefit-risk-framework.md +16 -0
  14. pharmaskills/_skills/aggregate-report/references/dsur-sections.md +16 -0
  15. pharmaskills/_skills/aggregate-report/references/pbrer-sections.md +19 -0
  16. pharmaskills/_skills/aggregate-report/scripts/check_aggregate.sh +8 -0
  17. pharmaskills/_skills/aggregate-report/templates/dsur-outline.md +44 -0
  18. pharmaskills/_skills/aggregate-report/templates/pbrer-outline.md +54 -0
  19. pharmaskills/_skills/competitive-landscape/SKILL.md +127 -0
  20. pharmaskills/_skills/competitive-landscape/references/ctgov-api.md +30 -0
  21. pharmaskills/_skills/competitive-landscape/references/grouping-method.md +18 -0
  22. pharmaskills/_skills/competitive-landscape/scripts/run_landscape.sh +7 -0
  23. pharmaskills/_skills/competitive-landscape/templates/landscape.md +49 -0
  24. pharmaskills/_skills/competitive-landscape/templates/mechanism-map.yaml +3 -0
  25. pharmaskills/_skills/compound-profiler/SKILL.md +117 -0
  26. pharmaskills/_skills/compound-profiler/references/interpretation.md +27 -0
  27. pharmaskills/_skills/compound-profiler/references/refusal-policy.md +18 -0
  28. pharmaskills/_skills/compound-profiler/scripts/run_profile.sh +7 -0
  29. pharmaskills/_skills/compound-profiler/templates/profile.md +32 -0
  30. pharmaskills/_skills/crf-cdash/SKILL.md +124 -0
  31. pharmaskills/_skills/crf-cdash/references/cdash-forms.md +33 -0
  32. pharmaskills/_skills/crf-cdash/references/forms-from-soa.md +27 -0
  33. pharmaskills/_skills/crf-cdash/scripts/build_spec.sh +14 -0
  34. pharmaskills/_skills/crf-cdash/templates/crf-spec.md +25 -0
  35. pharmaskills/_skills/crf-cdash/templates/fields.csv +5 -0
  36. pharmaskills/_skills/csr-e3/SKILL.md +124 -0
  37. pharmaskills/_skills/csr-e3/references/e3-sections.md +32 -0
  38. pharmaskills/_skills/csr-e3/references/number-tracing.md +13 -0
  39. pharmaskills/_skills/csr-e3/scripts/check_csr.sh +11 -0
  40. pharmaskills/_skills/csr-e3/templates/csr-section.md +6 -0
  41. pharmaskills/_skills/csv-gamp5/SKILL.md +140 -0
  42. pharmaskills/_skills/csv-gamp5/references/ai-systems.md +16 -0
  43. pharmaskills/_skills/csv-gamp5/references/gamp-categories.md +19 -0
  44. pharmaskills/_skills/csv-gamp5/references/risk-based-rigour.md +22 -0
  45. pharmaskills/_skills/csv-gamp5/references/validating-pharmaskills.md +31 -0
  46. pharmaskills/_skills/csv-gamp5/scripts/check_checklist.sh +7 -0
  47. pharmaskills/_skills/csv-gamp5/templates/risk-assessment.md +5 -0
  48. pharmaskills/_skills/csv-gamp5/templates/urs.md +11 -0
  49. pharmaskills/_skills/csv-gamp5/templates/validate-pharmaskills.md +11 -0
  50. pharmaskills/_skills/ctd-module2/SKILL.md +122 -0
  51. pharmaskills/_skills/ctd-module2/references/cross-references.md +16 -0
  52. pharmaskills/_skills/ctd-module2/references/m4-module2.md +29 -0
  53. pharmaskills/_skills/ctd-module2/scripts/check_module2.sh +7 -0
  54. pharmaskills/_skills/ctd-module2/templates/gap-list.csv +2 -0
  55. pharmaskills/_skills/ctd-module2/templates/module2-section.md +6 -0
  56. pharmaskills/_skills/define-xml/SKILL.md +119 -0
  57. pharmaskills/_skills/define-xml/references/define-xml-notes.md +21 -0
  58. pharmaskills/_skills/define-xml/references/validation-rules.md +17 -0
  59. pharmaskills/_skills/define-xml/scripts/run_define.sh +10 -0
  60. pharmaskills/_skills/define-xml/templates/define-review.md +21 -0
  61. pharmaskills/_skills/deviation-capa/SKILL.md +139 -0
  62. pharmaskills/_skills/deviation-capa/references/capa-fields.md +15 -0
  63. pharmaskills/_skills/deviation-capa/references/product-impact.md +17 -0
  64. pharmaskills/_skills/deviation-capa/references/root-cause-methods.md +37 -0
  65. pharmaskills/_skills/deviation-capa/scripts/check_capa.sh +8 -0
  66. pharmaskills/_skills/deviation-capa/templates/capa.csv +2 -0
  67. pharmaskills/_skills/deviation-capa/templates/investigation.md +47 -0
  68. pharmaskills/_skills/fih-dose/SKILL.md +124 -0
  69. pharmaskills/_skills/fih-dose/references/guidance-notes.md +11 -0
  70. pharmaskills/_skills/fih-dose/references/mrsd-and-mabel.md +34 -0
  71. pharmaskills/_skills/fih-dose/scripts/run_hed.sh +5 -0
  72. pharmaskills/_skills/fih-dose/templates/fih_dose.md +39 -0
  73. pharmaskills/_skills/ha-query-response/SKILL.md +113 -0
  74. pharmaskills/_skills/ha-query-response/references/citation-conventions.md +27 -0
  75. pharmaskills/_skills/ha-query-response/references/response-structure.md +14 -0
  76. pharmaskills/_skills/ha-query-response/scripts/check_response.sh +7 -0
  77. pharmaskills/_skills/ha-query-response/templates/response.md +24 -0
  78. pharmaskills/_skills/heor-model/SKILL.md +112 -0
  79. pharmaskills/_skills/heor-model/references/budget-impact.md +14 -0
  80. pharmaskills/_skills/heor-model/references/icer-methods.md +18 -0
  81. pharmaskills/_skills/heor-model/scripts/run_icer.sh +11 -0
  82. pharmaskills/_skills/heor-model/templates/heor-summary.md +26 -0
  83. pharmaskills/_skills/ib-writer/SKILL.md +111 -0
  84. pharmaskills/_skills/ib-writer/references/ib-content.md +24 -0
  85. pharmaskills/_skills/ib-writer/references/rsi-conventions.md +20 -0
  86. pharmaskills/_skills/ib-writer/scripts/check_ib.sh +7 -0
  87. pharmaskills/_skills/ib-writer/templates/ib-outline.md +26 -0
  88. pharmaskills/_skills/ib-writer/templates/rsi.schema.yaml +22 -0
  89. pharmaskills/_skills/icf-writer/SKILL.md +114 -0
  90. pharmaskills/_skills/icf-writer/references/50-25-elements.md +38 -0
  91. pharmaskills/_skills/icf-writer/references/plain-language.md +19 -0
  92. pharmaskills/_skills/icf-writer/scripts/check_icf.sh +10 -0
  93. pharmaskills/_skills/icf-writer/templates/icf.md +75 -0
  94. pharmaskills/_skills/icsr-e2b/SKILL.md +135 -0
  95. pharmaskills/_skills/icsr-e2b/references/e2b-r3-notes.md +15 -0
  96. pharmaskills/_skills/icsr-e2b/references/reporting-criteria.md +39 -0
  97. pharmaskills/_skills/icsr-e2b/scripts/run_icsr.sh +11 -0
  98. pharmaskills/_skills/icsr-e2b/templates/case-summary.md +29 -0
  99. pharmaskills/_skills/icsr-e2b/templates/case.json +16 -0
  100. pharmaskills/_skills/ind-assembler/SKILL.md +114 -0
  101. pharmaskills/_skills/ind-assembler/references/ectd-placement.md +13 -0
  102. pharmaskills/_skills/ind-assembler/references/ind-items.md +25 -0
  103. pharmaskills/_skills/ind-assembler/scripts/run_ind.sh +13 -0
  104. pharmaskills/_skills/ind-assembler/templates/facts.yaml +11 -0
  105. pharmaskills/_skills/ind-assembler/templates/ind-map.md +28 -0
  106. pharmaskills/_skills/label-writer/SKILL.md +123 -0
  107. pharmaskills/_skills/label-writer/references/comparator-comparison.md +12 -0
  108. pharmaskills/_skills/label-writer/references/smpc-order.md +14 -0
  109. pharmaskills/_skills/label-writer/references/us-pi-order.md +19 -0
  110. pharmaskills/_skills/label-writer/scripts/fetch_comparator.sh +7 -0
  111. pharmaskills/_skills/label-writer/scripts/make_docx.sh +8 -0
  112. pharmaskills/_skills/label-writer/templates/comparison.md +18 -0
  113. pharmaskills/_skills/label-writer/templates/smpc.md +105 -0
  114. pharmaskills/_skills/label-writer/templates/us-pi.md +71 -0
  115. pharmaskills/_skills/lifecycle-navigator/SKILL.md +118 -0
  116. pharmaskills/_skills/lifecycle-navigator/references/ind-pathway.md +24 -0
  117. pharmaskills/_skills/lifecycle-navigator/references/lifecycle-map.md +42 -0
  118. pharmaskills/_skills/lifecycle-navigator/references/modality-guidance.md +12 -0
  119. pharmaskills/_skills/lifecycle-navigator/scripts/route_check.sh +5 -0
  120. pharmaskills/_skills/lifecycle-navigator/templates/program_plan.md +44 -0
  121. pharmaskills/_skills/literature-review/SKILL.md +124 -0
  122. pharmaskills/_skills/literature-review/references/prisma-schema.md +42 -0
  123. pharmaskills/_skills/literature-review/references/search-and-screening.md +16 -0
  124. pharmaskills/_skills/literature-review/scripts/run_prisma_check.sh +7 -0
  125. pharmaskills/_skills/literature-review/templates/review.md +48 -0
  126. pharmaskills/_skills/literature-surveillance/SKILL.md +119 -0
  127. pharmaskills/_skills/literature-surveillance/references/icsr-criteria.md +27 -0
  128. pharmaskills/_skills/literature-surveillance/references/search-and-log.md +14 -0
  129. pharmaskills/_skills/literature-surveillance/scripts/run_weekly.sh +10 -0
  130. pharmaskills/_skills/literature-surveillance/templates/potential-icsrs.md +29 -0
  131. pharmaskills/_skills/nonclinical-study-plan/SKILL.md +116 -0
  132. pharmaskills/_skills/nonclinical-study-plan/references/biologics-s6r1.md +13 -0
  133. pharmaskills/_skills/nonclinical-study-plan/references/m3r2-study-matrix.md +23 -0
  134. pharmaskills/_skills/nonclinical-study-plan/references/oncology-s9.md +19 -0
  135. pharmaskills/_skills/nonclinical-study-plan/references/species-and-duration.md +14 -0
  136. pharmaskills/_skills/nonclinical-study-plan/scripts/required_studies.sh +5 -0
  137. pharmaskills/_skills/nonclinical-study-plan/templates/nonclinical_plan.md +37 -0
  138. pharmaskills/_skills/pk-nca/SKILL.md +117 -0
  139. pharmaskills/_skills/pk-nca/references/guidance-notes.md +13 -0
  140. pharmaskills/_skills/pk-nca/references/nca-methods.md +42 -0
  141. pharmaskills/_skills/pk-nca/scripts/run_nca.sh +7 -0
  142. pharmaskills/_skills/pk-nca/templates/nca_report.md +34 -0
  143. pharmaskills/_skills/protocol-m11/SKILL.md +130 -0
  144. pharmaskills/_skills/protocol-m11/references/estimands.md +26 -0
  145. pharmaskills/_skills/protocol-m11/references/m11-structure.md +33 -0
  146. pharmaskills/_skills/protocol-m11/references/soa-layout.md +22 -0
  147. pharmaskills/_skills/protocol-m11/scripts/check_protocol.sh +11 -0
  148. pharmaskills/_skills/protocol-m11/templates/estimand-block.md +7 -0
  149. pharmaskills/_skills/protocol-m11/templates/protocol-skeleton.md +110 -0
  150. pharmaskills/_skills/protocol-m11/templates/soa.csv +6 -0
  151. pharmaskills/_skills/rbqm-plan/SKILL.md +112 -0
  152. pharmaskills/_skills/rbqm-plan/references/rbqm-concepts.md +23 -0
  153. pharmaskills/_skills/rbqm-plan/references/register-format.md +22 -0
  154. pharmaskills/_skills/rbqm-plan/scripts/check_risk_register.sh +5 -0
  155. pharmaskills/_skills/rbqm-plan/templates/rbqm_plan.md +33 -0
  156. pharmaskills/_skills/regulatory-intelligence/SKILL.md +109 -0
  157. pharmaskills/_skills/regulatory-intelligence/references/impact-assessment.md +10 -0
  158. pharmaskills/_skills/regulatory-intelligence/references/official-sources.md +27 -0
  159. pharmaskills/_skills/regulatory-intelligence/scripts/fetch_page.sh +11 -0
  160. pharmaskills/_skills/regulatory-intelligence/templates/intel-brief.md +27 -0
  161. pharmaskills/_skills/sample-size/SKILL.md +114 -0
  162. pharmaskills/_skills/sample-size/references/designs.md +27 -0
  163. pharmaskills/_skills/sample-size/references/guidance-notes.md +19 -0
  164. pharmaskills/_skills/sample-size/scripts/run_sample_size.sh +5 -0
  165. pharmaskills/_skills/sample-size/templates/sample-size.md +33 -0
  166. pharmaskills/_skills/sap-writer/SKILL.md +115 -0
  167. pharmaskills/_skills/sap-writer/references/e9-topics.md +26 -0
  168. pharmaskills/_skills/sap-writer/references/estimand-to-analysis.md +16 -0
  169. pharmaskills/_skills/sap-writer/references/multiplicity-and-interim.md +14 -0
  170. pharmaskills/_skills/sap-writer/scripts/check_sap.sh +6 -0
  171. pharmaskills/_skills/sap-writer/templates/sap.md +40 -0
  172. pharmaskills/_skills/sdtm-mapper/SKILL.md +156 -0
  173. pharmaskills/_skills/sdtm-mapper/references/conformance.md +13 -0
  174. pharmaskills/_skills/sdtm-mapper/references/dsl.md +64 -0
  175. pharmaskills/_skills/sdtm-mapper/references/review-workflow.md +15 -0
  176. pharmaskills/_skills/sdtm-mapper/scripts/run_sdtm.sh +7 -0
  177. pharmaskills/_skills/sdtm-mapper/templates/review-checklist.md +9 -0
  178. pharmaskills/_skills/sdtm-mapper/templates/study.yaml +17 -0
  179. pharmaskills/_skills/send-checker/SKILL.md +111 -0
  180. pharmaskills/_skills/send-checker/references/guidance-notes.md +11 -0
  181. pharmaskills/_skills/send-checker/references/native-rules.md +27 -0
  182. pharmaskills/_skills/send-checker/scripts/run_send_validate.sh +7 -0
  183. pharmaskills/_skills/send-checker/templates/send_report.md +33 -0
  184. pharmaskills/_skills/signal-detection/SKILL.md +114 -0
  185. pharmaskills/_skills/signal-detection/references/faers-limitations.md +12 -0
  186. pharmaskills/_skills/signal-detection/references/thresholds.md +18 -0
  187. pharmaskills/_skills/signal-detection/scripts/run_signal.sh +7 -0
  188. pharmaskills/_skills/signal-detection/templates/signal-report.md +35 -0
  189. pharmaskills/_skills/specification-builder/SKILL.md +121 -0
  190. pharmaskills/_skills/specification-builder/references/impurity-solvent-elemental.md +19 -0
  191. pharmaskills/_skills/specification-builder/references/q6a-tests.md +19 -0
  192. pharmaskills/_skills/specification-builder/references/q6b-tests.md +17 -0
  193. pharmaskills/_skills/specification-builder/scripts/run_thresholds.sh +8 -0
  194. pharmaskills/_skills/specification-builder/templates/rationale.md +25 -0
  195. pharmaskills/_skills/stability-protocol/SKILL.md +122 -0
  196. pharmaskills/_skills/stability-protocol/references/climatic-zones.md +17 -0
  197. pharmaskills/_skills/stability-protocol/references/q1a-conditions.md +20 -0
  198. pharmaskills/_skills/stability-protocol/references/q1e-shelf-life.md +17 -0
  199. pharmaskills/_skills/stability-protocol/scripts/make_docx.sh +8 -0
  200. pharmaskills/_skills/stability-protocol/scripts/run_conditions.sh +8 -0
  201. pharmaskills/_skills/stability-protocol/templates/shelf-life-summary.md +17 -0
  202. pharmaskills/_skills/stability-protocol/templates/stability-protocol.md +34 -0
  203. pharmaskills/_skills/target-dossier/SKILL.md +131 -0
  204. pharmaskills/_skills/target-dossier/references/dual-use-policy.md +13 -0
  205. pharmaskills/_skills/target-dossier/references/evidence-schema.md +18 -0
  206. pharmaskills/_skills/target-dossier/references/sources.md +13 -0
  207. pharmaskills/_skills/target-dossier/scripts/run_target_queries.sh +7 -0
  208. pharmaskills/_skills/target-dossier/templates/target_dossier.md +37 -0
  209. pharmaskills/_skills/tlf-shells/SKILL.md +107 -0
  210. pharmaskills/_skills/tlf-shells/references/shell-conventions.md +30 -0
  211. pharmaskills/_skills/tlf-shells/scripts/check_shells.sh +5 -0
  212. pharmaskills/_skills/tlf-shells/templates/tlf_shell.md +19 -0
  213. pharmaskills/_skills/trial-feasibility/SKILL.md +117 -0
  214. pharmaskills/_skills/trial-feasibility/references/guidance-notes.md +16 -0
  215. pharmaskills/_skills/trial-feasibility/references/rate-method.md +27 -0
  216. pharmaskills/_skills/trial-feasibility/scripts/run_feasibility.sh +7 -0
  217. pharmaskills/_skills/trial-feasibility/templates/feasibility.md +43 -0
  218. pharmaskills/adam/__init__.py +1 -0
  219. pharmaskills/adam/build.py +193 -0
  220. pharmaskills/adam/derive.py +444 -0
  221. pharmaskills/adam/spec.py +85 -0
  222. pharmaskills/adam/testing.py +221 -0
  223. pharmaskills/banners.py +74 -0
  224. pharmaskills/cdash/__init__.py +1 -0
  225. pharmaskills/cdash/data/cdash.yaml +107 -0
  226. pharmaskills/cdash/mapper.py +206 -0
  227. pharmaskills/cdash/spec.py +220 -0
  228. pharmaskills/chem/__init__.py +1 -0
  229. pharmaskills/chem/hazard.py +108 -0
  230. pharmaskills/chem/profile.py +232 -0
  231. pharmaskills/cli.py +478 -0
  232. pharmaskills/cli_adam.py +97 -0
  233. pharmaskills/cli_bench.py +273 -0
  234. pharmaskills/cli_cdash.py +133 -0
  235. pharmaskills/cli_chem.py +103 -0
  236. pharmaskills/cli_cmc.py +153 -0
  237. pharmaskills/cli_connectors.py +211 -0
  238. pharmaskills/cli_ct.py +155 -0
  239. pharmaskills/cli_define.py +142 -0
  240. pharmaskills/cli_docs.py +388 -0
  241. pharmaskills/cli_lit.py +82 -0
  242. pharmaskills/cli_mcp.py +252 -0
  243. pharmaskills/cli_protocol.py +124 -0
  244. pharmaskills/cli_pubmed.py +38 -0
  245. pharmaskills/cli_quality.py +124 -0
  246. pharmaskills/cli_reg.py +147 -0
  247. pharmaskills/cli_safety.py +239 -0
  248. pharmaskills/cli_sdtm.py +400 -0
  249. pharmaskills/cli_send.py +48 -0
  250. pharmaskills/cli_stats.py +386 -0
  251. pharmaskills/cli_trials.py +131 -0
  252. pharmaskills/cmc/__init__.py +1 -0
  253. pharmaskills/cmc/elemental.py +110 -0
  254. pharmaskills/cmc/solvents.py +226 -0
  255. pharmaskills/cmc/stability.py +166 -0
  256. pharmaskills/cmc/thresholds.py +140 -0
  257. pharmaskills/config.py +161 -0
  258. pharmaskills/connectors/__init__.py +36 -0
  259. pharmaskills/connectors/base.py +29 -0
  260. pharmaskills/connectors/cdisc_library.py +76 -0
  261. pharmaskills/connectors/chembl.py +115 -0
  262. pharmaskills/connectors/clinicaltrials.py +196 -0
  263. pharmaskills/connectors/ctconnector.py +70 -0
  264. pharmaskills/connectors/dailymed.py +106 -0
  265. pharmaskills/connectors/http.py +301 -0
  266. pharmaskills/connectors/openfda.py +222 -0
  267. pharmaskills/connectors/opentargets.py +154 -0
  268. pharmaskills/connectors/pubmed.py +218 -0
  269. pharmaskills/connectors/registry.py +109 -0
  270. pharmaskills/connectors/uniprot.py +78 -0
  271. pharmaskills/ct/__init__.py +27 -0
  272. pharmaskills/ct/loader.py +262 -0
  273. pharmaskills/data/agents.yaml +26 -0
  274. pharmaskills/define/__init__.py +7 -0
  275. pharmaskills/define/builder.py +357 -0
  276. pharmaskills/define/render.py +215 -0
  277. pharmaskills/define/validator.py +246 -0
  278. pharmaskills/docs/__init__.py +1 -0
  279. pharmaskills/docs/builders.py +221 -0
  280. pharmaskills/docs/checks.py +87 -0
  281. pharmaskills/docs/citations.py +346 -0
  282. pharmaskills/docs/data/icf_elements.yaml +116 -0
  283. pharmaskills/docs/data/official_domains.yaml +43 -0
  284. pharmaskills/docs/docx_util.py +36 -0
  285. pharmaskills/docs/icf.py +180 -0
  286. pharmaskills/docs/numbers.py +492 -0
  287. pharmaskills/docs/pii.py +178 -0
  288. pharmaskills/docs/readability.py +118 -0
  289. pharmaskills/docs/reader.py +72 -0
  290. pharmaskills/docs/structure.py +109 -0
  291. pharmaskills/doctor.py +147 -0
  292. pharmaskills/evalharness/__init__.py +1 -0
  293. pharmaskills/evalharness/checks.py +343 -0
  294. pharmaskills/evalharness/models.py +99 -0
  295. pharmaskills/evalharness/rubric.py +82 -0
  296. pharmaskills/evalharness/runner.py +214 -0
  297. pharmaskills/history.py +34 -0
  298. pharmaskills/lit/__init__.py +1 -0
  299. pharmaskills/lit/prisma.py +190 -0
  300. pharmaskills/lit/screening.py +87 -0
  301. pharmaskills/manifest.py +63 -0
  302. pharmaskills/mcp_server.py +484 -0
  303. pharmaskills/protocol/__init__.py +1 -0
  304. pharmaskills/protocol/estimands.py +231 -0
  305. pharmaskills/protocol/risk.py +106 -0
  306. pharmaskills/protocol/soa.py +102 -0
  307. pharmaskills/protocol/tlfshells.py +166 -0
  308. pharmaskills/qa/__init__.py +1 -0
  309. pharmaskills/qa/dashcheck.py +89 -0
  310. pharmaskills/qa/licenseguard.py +167 -0
  311. pharmaskills/quality/__init__.py +1 -0
  312. pharmaskills/quality/capa.py +148 -0
  313. pharmaskills/quality/data/part11_annex11.yaml +311 -0
  314. pharmaskills/quality/part11.py +147 -0
  315. pharmaskills/reg/__init__.py +1 -0
  316. pharmaskills/reg/ctd.py +268 -0
  317. pharmaskills/reg/data/required_studies.yaml +182 -0
  318. pharmaskills/reg/ind.py +321 -0
  319. pharmaskills/reg/required.py +103 -0
  320. pharmaskills/safety/__init__.py +14 -0
  321. pharmaskills/safety/case.py +147 -0
  322. pharmaskills/safety/criteria.py +86 -0
  323. pharmaskills/safety/e2b.py +395 -0
  324. pharmaskills/safety/expectedness.py +149 -0
  325. pharmaskills/safety/meddra.py +104 -0
  326. pharmaskills/safety/schema.py +275 -0
  327. pharmaskills/safety/seriousness.py +185 -0
  328. pharmaskills/sdtm/__init__.py +1 -0
  329. pharmaskills/sdtm/benchmark.py +180 -0
  330. pharmaskills/sdtm/classify.py +101 -0
  331. pharmaskills/sdtm/core.py +130 -0
  332. pharmaskills/sdtm/csdrg.py +362 -0
  333. pharmaskills/sdtm/datasetjson.py +81 -0
  334. pharmaskills/sdtm/dates.py +218 -0
  335. pharmaskills/sdtm/engine.py +864 -0
  336. pharmaskills/sdtm/expr.py +228 -0
  337. pharmaskills/sdtm/init.py +118 -0
  338. pharmaskills/sdtm/metadata.py +78 -0
  339. pharmaskills/sdtm/models.py +151 -0
  340. pharmaskills/sdtm/native_rules.py +326 -0
  341. pharmaskills/sdtm/order.py +117 -0
  342. pharmaskills/sdtm/pipeline.py +93 -0
  343. pharmaskills/sdtm/profile.py +121 -0
  344. pharmaskills/sdtm/prompts/__init__.py +22 -0
  345. pharmaskills/sdtm/prompts/dsl.txt +16 -0
  346. pharmaskills/sdtm/prompts/propose.yaml +39 -0
  347. pharmaskills/sdtm/prompts/repair.yaml +23 -0
  348. pharmaskills/sdtm/propose.py +433 -0
  349. pharmaskills/sdtm/readers.py +88 -0
  350. pharmaskills/sdtm/repair.py +244 -0
  351. pharmaskills/sdtm/review.py +206 -0
  352. pharmaskills/sdtm/run.py +279 -0
  353. pharmaskills/sdtm/spec.py +234 -0
  354. pharmaskills/sdtm/trace.py +163 -0
  355. pharmaskills/sdtm/units.py +126 -0
  356. pharmaskills/sdtm/validate.py +115 -0
  357. pharmaskills/sdtm/validate_spec.py +239 -0
  358. pharmaskills/sdtm/xpt.py +166 -0
  359. pharmaskills/send/__init__.py +1 -0
  360. pharmaskills/send/validate.py +206 -0
  361. pharmaskills/skilltools/__init__.py +1 -0
  362. pharmaskills/skilltools/frontmatter.py +49 -0
  363. pharmaskills/skilltools/installer.py +242 -0
  364. pharmaskills/skilltools/lint.py +161 -0
  365. pharmaskills/skilltools/registry.py +91 -0
  366. pharmaskills/standards/__init__.py +19 -0
  367. pharmaskills/standards/data/cdisc/sdtmig-3.4.yaml +223 -0
  368. pharmaskills/standards/data/dsur.yaml +41 -0
  369. pharmaskills/standards/data/ib.yaml +28 -0
  370. pharmaskills/standards/data/icf.yaml +24 -0
  371. pharmaskills/standards/data/ich-e3.yaml +92 -0
  372. pharmaskills/standards/data/ich-m11.yaml +61 -0
  373. pharmaskills/standards/data/ich-m4.yaml +57 -0
  374. pharmaskills/standards/data/pbrer.yaml +50 -0
  375. pharmaskills/standards/data/sap.yaml +31 -0
  376. pharmaskills/standards/data/smpc.yaml +40 -0
  377. pharmaskills/standards/data/us-pi.yaml +55 -0
  378. pharmaskills/standards/loader.py +99 -0
  379. pharmaskills/stats/__init__.py +61 -0
  380. pharmaskills/stats/accuracy.py +110 -0
  381. pharmaskills/stats/disproportionality.py +98 -0
  382. pharmaskills/stats/hed.py +172 -0
  383. pharmaskills/stats/heor.py +254 -0
  384. pharmaskills/stats/nca.py +373 -0
  385. pharmaskills/stats/samplesize.py +528 -0
  386. pharmaskills/stats/shelflife.py +333 -0
  387. pharmaskills/trials/__init__.py +1 -0
  388. pharmaskills/trials/feasibility.py +254 -0
  389. pharmaskills/trials/landscape.py +140 -0
  390. pharmaskills/trials/studies.py +267 -0
  391. pharmaskills/util/__init__.py +1 -0
  392. pharmaskills/util/hashing.py +28 -0
  393. pharmaskills/util/log.py +34 -0
  394. pharmaskills/util/output.py +122 -0
  395. pharmaskills/util/paths.py +26 -0
  396. pharmaskills/util/xmlsafe.py +38 -0
  397. pharmaskills/validators.py +59 -0
  398. pharmaskills-0.6.0.dist-info/METADATA +262 -0
  399. pharmaskills-0.6.0.dist-info/RECORD +403 -0
  400. pharmaskills-0.6.0.dist-info/WHEEL +4 -0
  401. pharmaskills-0.6.0.dist-info/entry_points.txt +2 -0
  402. pharmaskills-0.6.0.dist-info/licenses/LICENSE +202 -0
  403. pharmaskills-0.6.0.dist-info/licenses/NOTICE +20 -0
@@ -0,0 +1,6 @@
1
+ """PharmaSkills: pharma skills for AI agents."""
2
+
3
+ from pharmaskills._meta import DISPLAY_NAME, NAME, VERSION
4
+
5
+ __all__ = ["DISPLAY_NAME", "NAME", "VERSION", "__version__"]
6
+ __version__ = VERSION
@@ -0,0 +1,4 @@
1
+ from pharmaskills.cli import main
2
+
3
+ if __name__ == "__main__":
4
+ main()
pharmaskills/_meta.py ADDED
@@ -0,0 +1,11 @@
1
+ """Single source of truth for the product identity (PRD s22).
2
+
3
+ A rename is one package-directory move plus ``[project] name`` in
4
+ ``pyproject.toml`` and ``name`` in ``.claude-plugin/plugin.json``.
5
+ """
6
+
7
+ NAME = "pharmaskills"
8
+ DISPLAY_NAME = "PharmaSkills"
9
+ VERSION = "0.6.0"
10
+ TAGLINE = "Pharma skills for AI agents."
11
+ USER_AGENT = f"{NAME}/{VERSION} (+https://github.com/aiagentpro/{NAME})"
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: adam-spec
3
+ description: Specify ADSL and ADAE from SDTM datasets and the SAP, then build the datasets, derivation programs and spec workbook with unit-tested derivations. Use for ADaM specification, ADSL or ADAE derivation, TRTEMFL or population flags.
4
+ license: Apache-2.0
5
+ metadata:
6
+ stage: clinical-data
7
+ tier: 1
8
+ standards: [ADaMIG 1.3, ADaM OCCDS 1.0, SDTMIG 3.4, ICH E9]
9
+ tools:
10
+ - pharmaskills adam build
11
+ - pharmaskills adam test
12
+ - pharmaskills docs banner
13
+ inputs: [sdtm_xpt_datasets, sap, study_yaml]
14
+ outputs: [adam_spec_yaml, adam_spec_xlsx, adsl_xpt, adae_xpt, adsl_py, adae_py, adam_build_report_json, adam_test_report_json]
15
+ gxp_note: Draft for qualified review. Not a validated system and not 21 CFR Part 11 compliant.
16
+ min_pharmaskills: "0.3.0"
17
+ ---
18
+
19
+ # ADaM specification (ADSL and ADAE)
20
+
21
+ ## Purpose
22
+
23
+ Produce a reviewable specification and the derived ADSL and ADAE analysis datasets for a
24
+ statistical programmer, starting from SDTM datasets and the statistical analysis plan (SAP).
25
+ You translate SAP definitions into a declarative spec (never into data), the deterministic
26
+ `pharmaskills adam` engine derives the datasets, and `pharmaskills adam test` proves the key
27
+ derivations. Everything is a draft for qualified human review.
28
+
29
+ ## When to use / when not to use
30
+
31
+ Use to specify or derive ADSL (population flags, treatment variables, treatment dates, age
32
+ groups) and ADAE (treatment-emergent flag, analysis dates, severity, duration, first
33
+ occurrence), or to check existing ADSL and ADAE derivations against the SAP.
34
+
35
+ Do not use for: any other ADaM dataset (ADTTE, ADLB, ADVS, ADEFF and all BDS parameter
36
+ datasets are out of scope in v1; say so and offer a specification outline marked unverified),
37
+ SDTM mapping (use `sdtm-mapper`), Define-XML (use `define-xml`), or real patient data that has
38
+ not been de-identified. Never hand-edit a derived dataset or a flag value.
39
+
40
+ ## Inputs
41
+
42
+ Required: SDTM XPT datasets DM, EX and AE (a folder of `.xpt` files or a study folder with
43
+ `out/sdtm/xpt`, `gold/sdtm` or `sdtm`), and the SAP (DOCX or Markdown) sections on analysis
44
+ populations, treatment definitions, treatment-emergent adverse events and subgroups.
45
+
46
+ Ask once for anything missing, then proceed with stated assumptions and `[DATA NEEDED: ...]`
47
+ placeholders. Typical gaps: follow-up window length, partial date rule, definition of the
48
+ safety population, age band cut points.
49
+
50
+ State the region assumed (US FDA with ICH unless told otherwise). If `pharmaskills` is not
51
+ installed, tell the user to run `uv tool install pharmaskills`, check `pharmaskills --version`
52
+ is at least `min_pharmaskills`, and produce only the spec outline and notes, clearly marked
53
+ unverified, with no datasets.
54
+
55
+ ## Workflow
56
+
57
+ You are the model in steps 1, 2 and 6. Everything else is a deterministic CLI call.
58
+
59
+ 1. **Read the SAP.** Extract the definitions listed in `references/derivations.md` (population,
60
+ TRT01P and TRT01A, TRTSDT and TRTEDT, treatment-emergent window, partial and missing date
61
+ rules, severity coding, age groups). Quote the SAP section for each. Where the SAP is
62
+ silent, choose the documented default, record it as an assumption and flag it.
63
+ 2. **Write `adam_spec.yaml`** from `templates/adam_spec.yaml`: arms keyed by ARMCD, age bands,
64
+ `followup_days`, `partial_start` (`conservative`, `earliest` or `latest`),
65
+ `missing_start_is_emergent`, `safety_min_dose`. Never put data values in the spec.
66
+ 3. **Build.** `pharmaskills adam build <sdtm-or-study> --spec adam_spec.yaml --out out/`
67
+ writes `adsl.xpt`, `adae.xpt`, Dataset-JSON, `adam_spec.xlsx`, `adsl.py`, `adae.py` and
68
+ `adam_build_report.json`. The same inputs give byte-identical files.
69
+ 4. **Test.** `pharmaskills adam test <sdtm-or-study> --spec adam_spec.yaml --expected
70
+ expected_values.yaml --out out/adam_test_report.json`. Built-in checks cover one row per
71
+ subject, SAFFL from exposure, TRTEMFL against an independent recomputation and record counts.
72
+ Build `expected_values.yaml` from the raw SDTM by hand for known cases (pre-treatment event,
73
+ partial start date, missing start date, event inside the follow-up window); see
74
+ `templates/expected_values.yaml`. Never copy values from the build output into it.
75
+ 5. **Repair loop (maximum 3 iterations).** On a failure find the cause in the spec or the SAP
76
+ reading, change the spec, rebuild and retest. Never change a dataset value or weaken a check.
77
+ 6. **Document.** Write `out/adam_spec_notes.md` from `templates/adam-spec-notes.md`: decisions
78
+ with SAP citations, tool counts, assumptions, open items. Insert the draft banner and a
79
+ provenance block with `pharmaskills docs banner --apply out/adam_spec_notes.md`.
80
+ 7. **Report** using the output contract below.
81
+
82
+ ## Output contract
83
+
84
+ Under `out/`:
85
+
86
+ | File | Content |
87
+ | --- | --- |
88
+ | `adam_spec.yaml` | Declarative spec filled from the SAP |
89
+ | `adam_spec.xlsx` | Variable list (dataset, label, type, source, derivation) and parameters |
90
+ | `adsl.xpt`, `adae.xpt`, `adsl.json`, `adae.json` | XPT v5 and Dataset-JSON v1.1 datasets |
91
+ | `adsl.py`, `adae.py` | Readable derivation programs that call the tested library |
92
+ | `adam_build_report.json` | Counts, flags, input and output hashes |
93
+ | `adam_test_report.json` | One entry per derivation check with pass or fail |
94
+ | `adam_spec_notes.md` | Decisions, assumptions, open items, banner and provenance |
95
+
96
+ Dates are numeric SAS dates in XPT and ISO 8601 strings in Dataset-JSON. State plainly in the
97
+ answer: the scope (ADSL and ADAE only), record counts, flag counts, check results and
98
+ every assumption.
99
+
100
+ ## Verification
101
+
102
+ Run and report pass or fail for each: `adam build` (exit 0), `adam test` (exit 0, all checks),
103
+ `pharmaskills docs banner` applied to the notes. Acceptance on the synthetic benchmark PSK-001:
104
+ ADSL has one row per subject (138), SAFFL is Y for the 120 treated subjects, TRTEMFL matches
105
+ the independent recomputation for all 168 AE records, rebuild is byte-identical. On failure
106
+ fix the spec and rerun up to three times, then report what remains. No CDISC CORE ADaM run is
107
+ performed by this skill; say so and do not describe the datasets as conformant.
108
+
109
+ ## Guardrails
110
+
111
+ - Insert the draft banner in every generated document; never claim the datasets are validated,
112
+ submission-ready or CORE-clean.
113
+ - Never fabricate data, subject values, dates, flags or SAP content. Missing SAP rules become
114
+ `[DATA NEEDED: ...]` placeholders plus a flagged assumption.
115
+ - Never write or edit ADaM records directly and never run model-generated code over the data.
116
+ Only the spec changes; the engine executes it.
117
+ - Refuse requests to set flags to improve a safety picture, to hide events or to bypass the
118
+ SAP definition; offer a documented sensitivity analysis instead.
119
+ - ADSL and ADAE only; state that other ADaM datasets are out of scope in v1.
120
+ - Warn when inputs look like real patient data; `pharmaskills docs detect-pii` checks this.
121
+ - Every claim about a guideline cites identifier and section (see `references/`).
122
+
123
+ ## References
124
+
125
+ - `references/derivations.md` - supported derivations, rules, defaults and limits of v1
126
+ - `references/adam-notes.md` - ADaMIG 1.3 and OCCDS 1.0 notes with section citations
127
+ - `references/spec-format.md` - the YAML spec and expected-values file formats
128
+ - Public sources: CDISC ADaM Implementation Guide v1.3 and ADaM OCCDS v1.0 (cdisc.org/standards),
129
+ ICH E9 (database.ich.org), CDISC SDTMIG 3.4.
130
+
131
+ Templates: `templates/adam_spec.yaml`, `templates/expected_values.yaml`,
132
+ `templates/adam-spec-notes.md`. Script: `scripts/run_adam.sh` (thin wrapper around
133
+ `pharmaskills adam build` and `adam test`).
134
+
135
+ ## Examples
136
+
137
+ Worked example with inputs and outputs: `examples/clinical-data/adam-spec/`. Synthetic inputs:
138
+ `skills/adam-spec/evals/fixtures/` (DM, EX and AE of PSK-001, a SAP excerpt, expected values).
@@ -0,0 +1,20 @@
1
+ # ADaM notes with citations
2
+
3
+ Written for this project; summarises public CDISC and ICH guidance, no standard text is copied.
4
+
5
+ - ADaMIG v1.3, section 3 (ADSL): one record per subject, population indicator flags such as
6
+ SAFFL and ITTFL carry Y or N, treatment variables TRTxxP and TRTxxA with numeric
7
+ counterparts, treatment dates TRTSDT and TRTEDT. Verify section numbers against the IG you
8
+ hold. https://www.cdisc.org/standards/foundational/adam
9
+ - ADaM OCCDS v1.0, section 3 (occurrence data structure): ADAE is an OCCDS dataset with one
10
+ row per reported occurrence, analysis dates ASTDT and AENDT, relative days ASTDY and AENDY,
11
+ and TRTEMFL as the treatment-emergent analysis flag. https://www.cdisc.org/standards/foundational/adam
12
+ - ADaMIG v1.3, section 4 (date and time variables): analysis dates are numeric dates with a
13
+ date format; imputation flags (ASTDTF, AENDTF) record the imputed component. The engine
14
+ writes numeric SAS dates in XPT and ISO 8601 in Dataset-JSON.
15
+ - ICH E9 section 5.2 (analysis sets): the analysis populations come from the protocol and SAP,
16
+ so population flags must be traceable to a SAP definition. https://database.ich.org/sites/default/files/E9_Guideline.pdf
17
+ - ICH E3 section 12.2 (adverse events): displays of adverse events use the treatment-emergent
18
+ definition stated in the SAP. https://database.ich.org/sites/default/files/E3_Guideline.pdf
19
+ - CDISC CORE (open-source conformance engine) is the intended place to run ADaM conformance
20
+ rules; the native checks in `adam test` are derivation unit tests, not conformance rules.
@@ -0,0 +1,39 @@
1
+ # Supported derivations in `pharmaskills adam` v1
2
+
3
+ Written for this project. It summarises what the engine does, not the CDISC standard text.
4
+ Scope: ADSL and ADAE only. ADTTE, ADLB, ADVS, ADEFF and every other BDS dataset are out of
5
+ scope; there is no baseline, visit windowing, imputation of treatment dates, multi-period
6
+ treatment, worsening-based emergence or time-to-event derivation in v1.
7
+
8
+ ## ADSL (one row per DM subject)
9
+
10
+ | Variable | Rule | Spec keys |
11
+ | --- | --- | --- |
12
+ | TRT01P, TRT01PN | Lookup of ARMCD in `arms`; null when ARMCD is in `not_randomised_armcds` | `arms`, `not_randomised_armcds` |
13
+ | TRT01A, TRT01AN | Lookup of ACTARMCD in `arms` for subjects with exposure | `arms` |
14
+ | TRTSDT, TRTEDT | Min EXSTDTC and max EXENDTC over EX records with complete dates and EXDOSE at or above the threshold | `safety_min_dose` |
15
+ | TRTDURD | TRTEDT minus TRTSDT plus 1 | none |
16
+ | SAFFL | Y when the subject has at least one qualifying EX record, else N | `safety_min_dose` |
17
+ | ITTFL | Y when ARMCD is a randomised arm of the spec | `arms`, `not_randomised_armcds` |
18
+ | AGEGR1, AGEGR1N | First inclusive band containing AGE | `age_bands` |
19
+
20
+ Placebo exposure has EXDOSE 0, so the default threshold 0 (greater than or equal) counts it.
21
+ EX records with a partial start date or a missing dose do not count as exposure; report them.
22
+
23
+ ## ADAE (one row per AE record, subject variables merged from ADSL)
24
+
25
+ | Variable | Rule |
26
+ | --- | --- |
27
+ | ASTDT, ASTDTF | AESTDTC as a date. Partial dates: `conservative` imputes the first dose date when it lies inside the partial period, else the first day; `earliest` the first day; `latest` the last day. Flag D (day) or M (month and day) |
28
+ | AENDT, AENDTF | AEENDTC as a date; partial dates per `partial_end`; null when ongoing |
29
+ | ASTDY, AENDY | Date minus TRTSDT, plus 1 when on or after TRTSDT (no day 0) |
30
+ | ADURN, ADURU | AENDT minus ASTDT plus 1 days |
31
+ | AESEVN | `ae.severity` map (MILD 1, MODERATE 2, SEVERE 3) |
32
+ | TRTEMFL | Y when TRTSDT <= ASTDT <= TRTEDT + `followup_days`; missing ASTDT follows `missing_start_is_emergent`; null when the subject was not treated |
33
+ | AOCCFL | Y on the first treatment-emergent record per subject by ASTDT then AESEQ |
34
+
35
+ ## Assumptions to state every time
36
+
37
+ Follow-up window length, partial date rule, missing start rule, severity coding, safety
38
+ population definition and the region (US FDA with ICH by default). Each must be traceable to a
39
+ SAP section or flagged as an assumption.
@@ -0,0 +1,29 @@
1
+ # Spec and expected-values formats
2
+
3
+ ## `adam_spec.yaml` (validated by `pharmaskills adam build`; unknown keys are errors)
4
+
5
+ ```yaml
6
+ study: PSK-001
7
+ arms: {PBO: {trt: Placebo, n: 1}, ACT: {trt: Active 10 mg, n: 2}}
8
+ not_randomised_armcds: [SCRNFAIL, NOTASSGN, NOTTRT]
9
+ safety_min_dose: 0.0
10
+ age_bands: [{label: "<45", n: 1, high: 44}, {label: ">=45", n: 2, low: 45}]
11
+ ae: {followup_days: 30, partial_start: conservative, partial_end: latest,
12
+ missing_start_is_emergent: true, severity: {MILD: 1, MODERATE: 2, SEVERE: 3}}
13
+ ```
14
+
15
+ ## `expected_values.yaml` (read by `pharmaskills adam test --expected`)
16
+
17
+ ```yaml
18
+ adsl:
19
+ subjects: # per subject, any ADSL variable; dates as ISO strings
20
+ PSK-001-101-001: {SAFFL: Y, TRT01A: Active 10 mg, TRTSDT: "2025-02-15"}
21
+ counts: {SAFFL: {Y: 120, N: 18}}
22
+ adae:
23
+ records: # per USUBJID and AESEQ, any ADAE variable
24
+ - {USUBJID: PSK-001-101-007, AESEQ: 1, TRTEMFL: null}
25
+ counts: {TRTEMFL: {Y: 161}}
26
+ ```
27
+
28
+ Exit codes: 0 all checks passed, 1 input or spec error, 2 at least one check failed (the report
29
+ JSON lists every check with its detail).
@@ -0,0 +1,14 @@
1
+ #!/bin/sh
2
+ # Thin wrapper: build ADSL and ADAE, then run the derivation tests.
3
+ # Usage: run_adam.sh <sdtm-or-study-folder> <adam_spec.yaml> [expected_values.yaml] [out-dir]
4
+ set -eu
5
+ sdtm="${1:?usage: run_adam.sh <sdtm-or-study-folder> <adam_spec.yaml> [expected.yaml] [out]}"
6
+ spec="${2:?missing adam_spec.yaml}"
7
+ expected="${3:-}"
8
+ out="${4:-out}"
9
+ pharmaskills adam build "$sdtm" --spec "$spec" --out "$out"
10
+ if [ -n "$expected" ]; then
11
+ exec pharmaskills adam test "$sdtm" --spec "$spec" --expected "$expected" \
12
+ --out "$out/adam_test_report.json"
13
+ fi
14
+ exec pharmaskills adam test "$sdtm" --spec "$spec" --out "$out/adam_test_report.json"
@@ -0,0 +1,25 @@
1
+ # ADSL and ADAE derivation notes for <STUDYID>
2
+
3
+ Region assumed: <US FDA with ICH | other>. Source: <SDTM datasets and SAP version>.
4
+ Scope: ADSL and ADAE only (v1).
5
+
6
+ ## Results of `pharmaskills adam build`
7
+
8
+ | Item | Value |
9
+ | --- | --- |
10
+ | ADSL records | <from adam_build_report.json> |
11
+ | ADAE records | <from adam_build_report.json> |
12
+ | SAFFL = Y | <from adam_build_report.json> |
13
+ | TRTEMFL = Y | <from adam_build_report.json> |
14
+
15
+ ## Derivation decisions
16
+
17
+ - <variable>: <rule> (SAP section <n>; ADaMIG 1.3 section <n>)
18
+
19
+ ## Verification (`pharmaskills adam test`)
20
+
21
+ <n of n> checks passed: <list>.
22
+
23
+ ## Open items
24
+
25
+ - [DATA NEEDED: <SAP rule or input that was missing>]
@@ -0,0 +1,18 @@
1
+ # ADaM v1 spec for `pharmaskills adam build` and `adam test` (ADSL and ADAE only).
2
+ # Fill every value from the SAP; leave a [DATA NEEDED: ...] comment for anything the SAP omits.
3
+ study: PSK-001 # STUDYID from the SDTM data
4
+ arms: # keyed by SDTM ARMCD / ACTARMCD; SAP section on treatments
5
+ PBO: {trt: Placebo, n: 1}
6
+ ACT: {trt: Active 10 mg, n: 2}
7
+ not_randomised_armcds: [SCRNFAIL, NOTASSGN, NOTTRT]
8
+ safety_min_dose: 0.0 # EXDOSE >= this value counts as exposure (placebo is 0)
9
+ age_bands: # SAP section on subgroups; null low or high = open end
10
+ - {label: "<45", n: 1, high: 44}
11
+ - {label: "45-64", n: 2, low: 45, high: 64}
12
+ - {label: ">=65", n: 3, low: 65}
13
+ ae:
14
+ followup_days: 30 # treatment-emergent window after TRTEDT (SAP definition)
15
+ partial_start: conservative # conservative | earliest | latest
16
+ partial_end: latest # earliest | latest
17
+ missing_start_is_emergent: true
18
+ severity: {MILD: 1, MODERATE: 2, SEVERE: 3}
@@ -0,0 +1,13 @@
1
+ # Hand-built expected values for `pharmaskills adam test --expected`.
2
+ # Compute every value from the raw SDTM records yourself. Never copy them from a build output.
3
+ adsl:
4
+ subjects:
5
+ # USUBJID: {SAFFL: Y, TRT01A: "<arm text>", TRTSDT: "YYYY-MM-DD", TRTEDT: "YYYY-MM-DD"}
6
+ counts:
7
+ # SAFFL: {Y: <n>, N: <n>}
8
+ adae:
9
+ records:
10
+ # - {USUBJID: "<id>", AESEQ: <n>, TRTEMFL: Y} # on treatment
11
+ # - {USUBJID: "<id>", AESEQ: <n>, TRTEMFL: null} # starts before first dose
12
+ counts:
13
+ # TRTEMFL: {Y: <n>}
@@ -0,0 +1,115 @@
1
+ ---
2
+ name: aggregate-report
3
+ description: Draft a PBRER (ICH E2C(R2)) or DSUR (ICH E2F) section structure with data placeholders, a stated reporting interval and a structured benefit-risk framework; checks mandatory sections. Never invents exposure or conclusions. Draft for qualified review.
4
+ license: Apache-2.0
5
+ metadata:
6
+ stage: safety
7
+ tier: 2
8
+ standards: [ICH E2C(R2), ICH E2F, EU GVP Module VII]
9
+ tools:
10
+ - pharmaskills docs check-structure --standard pbrer
11
+ - pharmaskills docs check-structure --standard dsur
12
+ - pharmaskills docs build
13
+ - pharmaskills docs banner
14
+ inputs: [report_type, reporting_interval, data_summaries, clinical_tables, nonclinical_summaries]
15
+ outputs: [pbrer_docx, dsur_docx, structure_report_json]
16
+ gxp_note: Draft for qualified review. Not a validated system and not 21 CFR Part 11 compliant.
17
+ min_pharmaskills: "0.4.0"
18
+ ---
19
+
20
+ # Aggregate safety report drafter
21
+
22
+ ## Purpose
23
+
24
+ Produce the section skeleton of a periodic benefit-risk evaluation report (PBRER) or a
25
+ development safety update report (DSUR) in the order of the ICH format, with the reporting
26
+ interval stated, supplied data filled in with their sources, everything else a placeholder, and
27
+ a structured benefit-risk evaluation framework. It is a drafting aid for the safety physician
28
+ and the qualified person responsible for pharmacovigilance. It does not assess causality,
29
+ conclude on benefit-risk or replace their review and the sponsor's reporting obligations and
30
+ timelines.
31
+
32
+ ## When to use / when not to use
33
+
34
+ Use at the start of an aggregate report cycle, to get a compliant structure with the available
35
+ data placed and the gaps listed.
36
+
37
+ Do not use to write the benefit-risk conclusion, to select signals, to compute exposure
38
+ without supplied dosing or sales data, or to file the report. Do not choose the report type for
39
+ the user: a DSUR covers an investigational product in development, a PBRER an authorised
40
+ product (and the periodicity comes from the authority list or agreement).
41
+
42
+ ## Inputs
43
+
44
+ Required: report type (PBRER or DSUR), reporting interval (start, end, data lock point) and the
45
+ international birth date (IBD for PBRER, DIBD for DSUR). Optional: clinical tables with
46
+ denominators, nonclinical summaries, signal tables, exposure estimates, risk management plan.
47
+
48
+ Ask once for anything missing, then proceed with stated assumptions and
49
+ `[DATA NEEDED: ...]` placeholders. Never invent dates, exposure, counts or conclusions.
50
+
51
+ State the region assumed (default: US FDA and EU in ICH format; say what regional appendices
52
+ are not covered).
53
+
54
+ If the `pharmaskills` package is not installed, say `uv tool install pharmaskills`, draft from
55
+ the template and mark the structure check as not run.
56
+
57
+ ## Workflow
58
+
59
+ 1. **Confirm the report type and interval.** Write `Reporting interval: <start> to <end>`
60
+ (PBRER) or `Reporting period: <start> to <end>` (DSUR) in the first paragraph.
61
+ 2. **Create all sections in order** from `templates/pbrer-outline.md` or
62
+ `templates/dsur-outline.md`. Do not renumber or merge; mark not-applicable sections
63
+ "Not applicable" with a reason, never delete them.
64
+ 3. **Place supplied data** with `[Source: <file>]` and exact denominators. Everything else is
65
+ `[DATA NEEDED: <what and from whom>]`.
66
+ 4. **Benefit-risk section**: fill the framework table (`references/benefit-risk-framework.md`)
67
+ with evidence, source and uncertainty; assessment stays a placeholder for the safety
68
+ physician.
69
+ 5. **Build**: `pharmaskills docs build src.md --out pbrer.docx --skill aggregate-report`
70
+ (inserts the draft banner and provenance block).
71
+ 6. **Check**: `pharmaskills docs check-structure pbrer.docx --standard pbrer --out
72
+ pbrer_structure_report.json` (or `--standard dsur`).
73
+
74
+ ## Output contract
75
+
76
+ | File | Content |
77
+ | --- | --- |
78
+ | `pbrer.docx` or `dsur.docx` (plus `.md`) | All numbered sections, interval stated, benefit-risk table, banner first, provenance last |
79
+ | `<type>_structure_report.json` | Section presence report from the tool |
80
+
81
+ Every number traces to a supplied file; every placeholder names the missing item. Not-applicable
82
+ sections state why.
83
+
84
+ ## Verification
85
+
86
+ Run and report: `docs check-structure` exit code (0 expected), counts present and missing
87
+ required, that the interval line is present and matches the supplied dates, and the banner.
88
+ Recompute one count from a supplied table by hand and state it matches. If the tool is not
89
+ available, compare the headings to `references/pbrer-sections.md` by eye and say it was manual.
90
+
91
+ ## Guardrails
92
+
93
+ - Insert the draft banner in every generated document.
94
+ - Never fabricate exposure, case counts, signals, citations, PMIDs or NCT ids; use
95
+ `[DATA NEEDED: ...]`.
96
+ - Never write the benefit-risk conclusion or a statement that the balance is favourable; that
97
+ belongs to the qualified person after medical review.
98
+ - Do not infer causality from imbalance in counts; describe counts only.
99
+ - State the region and the report type assumed; the format differs between PBRER and DSUR.
100
+ - The report does not replace the sponsor's reporting obligations and timelines.
101
+
102
+ ## References
103
+
104
+ - `references/pbrer-sections.md` - PBRER (E2C(R2)) section order and what each needs
105
+ - `references/dsur-sections.md` - DSUR (E2F) section order and what each needs
106
+ - `references/benefit-risk-framework.md` - the structured evaluation table
107
+ - Public sources: ICH E2C(R2) and ICH E2F (ich.org), EU GVP Module VII (EMA).
108
+
109
+ Templates: `templates/pbrer-outline.md`, `templates/dsur-outline.md`. Script:
110
+ `scripts/check_aggregate.sh`.
111
+
112
+ ## Examples
113
+
114
+ Worked example, both report types, from synthetic data:
115
+ `examples/safety/aggregate-report/`. Fixtures: `skills/aggregate-report/evals/fixtures/`.
@@ -0,0 +1,16 @@
1
+ # Benefit-risk evaluation framework
2
+
3
+ A structure, not a conclusion. Rows are filled only from supplied evidence; the assessment cell
4
+ is written by the qualified person after medical review.
5
+
6
+ | Dimension | What goes in Evidence | Typical sources |
7
+ | --- | --- | --- |
8
+ | Condition and unmet need | Disease burden, current options | Indication dossier, literature |
9
+ | Key benefits | Efficacy results with effect size and interval | CSRs, TLFs |
10
+ | Key risks | Identified and potential risks with frequency and severity | Safety tables, signals |
11
+ | Risk management | Minimisation measures and their effectiveness | RMP, label |
12
+ | Overall conclusion | Left to the qualified person | Safety physician |
13
+
14
+ For each row record the source file and the main uncertainty (small database, short duration,
15
+ missing comparator, no causality assessment). Do not weigh benefits against risks in the draft;
16
+ state the data and the open questions.
@@ -0,0 +1,16 @@
1
+ # DSUR section order (ICH E2F)
2
+
3
+ Notes written for this project from the public table of contents; no guideline text copied.
4
+ Machine-readable list: `src/pharmaskills/standards/data/dsur.yaml` (UNSURE: subsection
5
+ numbering under sections 6 to 8 and 18; verify against the published PDF).
6
+
7
+ 1 Introduction. 2 Worldwide marketing approval status. 3 Actions taken for safety reasons. 4
8
+ Changes to reference safety information. 5 Inventory of trials. 6 Estimated cumulative exposure.
9
+ 7 Line listings and summary tabulations. 8 Significant findings from clinical trials (8.1 to
10
+ 8.5). 9 Non-interventional studies. 10 Other clinical trial or study safety information. 11
11
+ Marketing experience. 12 Non-clinical data. 13 Literature. 14 Other DSURs. 15 Lack of efficacy.
12
+ 16 Region-specific information. 17 Late-breaking information. 18 Overall safety assessment (18.1
13
+ risks, 18.2 benefit-risk considerations). 19 Summary of important risks. 20 Conclusions.
14
+
15
+ Notes: the reporting period is normally twelve months from the development international birth
16
+ date anniversary; state the actual dates supplied. Keep sections that do not apply and say why.
@@ -0,0 +1,19 @@
1
+ # PBRER section order (ICH E2C(R2))
2
+
3
+ Notes written for this project from the public table of contents; no guideline text copied.
4
+ Machine-readable list: `src/pharmaskills/standards/data/pbrer.yaml` (UNSURE: wording of some
5
+ subsection titles; verify against the published PDF before quoting).
6
+
7
+ 1 Introduction. 2 Worldwide marketing authorisation status. 3 Actions taken in the interval for
8
+ safety reasons. 4 Changes to reference safety information. 5 Estimated exposure (5.1 clinical
9
+ trials, 5.2 marketing). 6 Summary tabulations (6.1 reference information, 6.2 clinical trial
10
+ serious events, 6.3 post-marketing). 7 Significant clinical trial findings (7.1 to 7.5). 8
11
+ Non-interventional studies. 9 Other clinical trials and sources. 10 Non-clinical data. 11
12
+ Literature. 12 Other periodic reports. 13 Lack of efficacy in controlled trials. 14
13
+ Late-breaking information. 15 Signal overview. 16 Signal and risk evaluation (16.1 to 16.5).
14
+ 17 Benefit evaluation (17.1 to 17.3). 18 Integrated benefit-risk analysis (18.1 context, 18.2
15
+ evaluation). 19 Conclusions and actions. 20 Appendices.
16
+
17
+ Notes: the PBRER is cumulative in its evaluation, with interval data presented separately where
18
+ the format asks. State the interval, the IBD and the data lock point at the front. The reference
19
+ safety information version in force at the data lock point is named in section 4.
@@ -0,0 +1,8 @@
1
+ #!/bin/sh
2
+ # Thin wrapper: section check of a PBRER or DSUR draft.
3
+ # Usage: check_aggregate.sh <file.docx|file.md> <pbrer|dsur> [report.json]
4
+ set -eu
5
+ doc="${1:?usage: check_aggregate.sh <file> <pbrer|dsur> [report.json]}"
6
+ std="${2:?usage: check_aggregate.sh <file> <pbrer|dsur> [report.json]}"
7
+ report="${3:-${std}_structure_report.json}"
8
+ exec pharmaskills docs check-structure "$doc" --standard "$std" --out "$report"
@@ -0,0 +1,44 @@
1
+ # Development Safety Update Report: [DATA NEEDED: product]
2
+
3
+ Reporting period: [DATA NEEDED: start] to [DATA NEEDED: end]. Region assumed: [DATA NEEDED].
4
+ Development international birth date: [DATA NEEDED: DIBD]. Data lock point: [DATA NEEDED].
5
+
6
+ ## 1. Introduction
7
+ ## 2. Worldwide marketing approval status
8
+ ## 3. Actions taken in the reporting period for safety reasons
9
+ ## 4. Changes to reference safety information
10
+ ## 5. Inventory of clinical trials ongoing and completed during the reporting period
11
+ ## 6. Estimated cumulative exposure
12
+ ### 6.1 Cumulative subject exposure in the development programme
13
+ ### 6.2 Patient exposure from marketing experience
14
+ ## 7. Data in line listings and summary tabulations
15
+ ### 7.1 Reference information
16
+ ### 7.2 Line listings of serious adverse reactions during the reporting period
17
+ ### 7.3 Cumulative summary tabulations of serious adverse events
18
+ ## 8. Significant findings from clinical trials during the reporting period
19
+ ### 8.1 Completed clinical trials
20
+ ### 8.2 Ongoing clinical trials
21
+ ### 8.3 Long-term follow-up
22
+ ### 8.4 Other therapeutic use of investigational drug
23
+ ### 8.5 New safety data related to combination therapies
24
+ ## 9. Safety findings from non-interventional studies
25
+ ## 10. Other clinical trial or study safety information
26
+ ## 11. Safety findings from marketing experience
27
+ ## 12. Non-clinical data
28
+ ## 13. Literature
29
+ ## 14. Other DSURs
30
+ ## 15. Lack of efficacy
31
+ ## 16. Region-specific information
32
+ ## 17. Late-breaking information
33
+ ## 18. Overall safety assessment
34
+ ### 18.1 Evaluation of risks
35
+ ### 18.2 Benefit-risk considerations
36
+
37
+ | Dimension | Evidence | Source | Uncertainty | Assessment |
38
+ | --- | --- | --- | --- | --- |
39
+ | Key benefits | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] |
40
+ | Key risks | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] |
41
+ | Overall conclusion | [DATA NEEDED: qualified person] | | | |
42
+
43
+ ## 19. Summary of important risks
44
+ ## 20. Conclusions
@@ -0,0 +1,54 @@
1
+ # Periodic Benefit-Risk Evaluation Report: [DATA NEEDED: product]
2
+
3
+ Reporting interval: [DATA NEEDED: start] to [DATA NEEDED: end] (data lock point [DATA NEEDED]).
4
+ Region assumed: [DATA NEEDED]. International birth date: [DATA NEEDED: IBD].
5
+
6
+ ## 1. Introduction
7
+ ## 2. Worldwide marketing authorisation status
8
+ ## 3. Actions taken in the reporting interval for safety reasons
9
+ ## 4. Changes to reference safety information
10
+ ## 5. Estimated exposure and use patterns
11
+ ### 5.1 Cumulative subject exposure in clinical trials
12
+ ### 5.2 Cumulative and interval patient exposure from marketing experience
13
+ ## 6. Data in summary tabulations
14
+ ### 6.1 Reference information
15
+ ### 6.2 Cumulative summary tabulations of serious adverse events from clinical trials
16
+ ### 6.3 Cumulative and interval summary tabulations from post-marketing data sources
17
+ ## 7. Summaries of significant findings from clinical trials during the reporting interval
18
+ ### 7.1 Completed clinical trials
19
+ ### 7.2 Ongoing clinical trials
20
+ ### 7.3 Long-term follow-up
21
+ ### 7.4 Other therapeutic use of medicinal product
22
+ ### 7.5 New safety data related to fixed combination therapies
23
+ ## 8. Findings from non-interventional studies
24
+ ## 9. Information from other clinical trials and sources
25
+ ## 10. Non-clinical data
26
+ ## 11. Literature
27
+ ## 12. Other periodic reports
28
+ ## 13. Lack of efficacy in controlled clinical trials
29
+ ## 14. Late-breaking information
30
+ ## 15. Overview of signals: new, ongoing or closed
31
+ ## 16. Signal and risk evaluation
32
+ ### 16.1 Summary of safety concerns
33
+ ### 16.2 Signal evaluation
34
+ ### 16.3 Evaluation of risks and new information
35
+ ### 16.4 Characterisation of risks
36
+ ### 16.5 Effectiveness of risk minimisation
37
+ ## 17. Benefit evaluation
38
+ ### 17.1 Important baseline efficacy and effectiveness information
39
+ ### 17.2 Newly identified information on efficacy and effectiveness
40
+ ### 17.3 Characterisation of benefits
41
+ ## 18. Integrated benefit-risk analysis for authorised indications
42
+ ### 18.1 Benefit-risk context
43
+ ### 18.2 Benefit-risk analysis evaluation
44
+
45
+ | Dimension | Evidence | Source | Uncertainty | Assessment |
46
+ | --- | --- | --- | --- | --- |
47
+ | Condition and unmet need | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] |
48
+ | Key benefits | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] |
49
+ | Key risks | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] |
50
+ | Risk management | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] | [DATA NEEDED] |
51
+ | Overall conclusion | [DATA NEEDED: qualified person] | | | |
52
+
53
+ ## 19. Conclusions and actions
54
+ ## 20. Appendices to the PBRER