{"data":{"slug":"github-aipoch-medical-research-skills-scientific-skills-other-date-calculator-f4cad0352e6c","title":"Medical Date Calculator for Clinical Research","summary":"Calculate gestational age, estimated delivery dates, and follow-up visit windows for clinical trials and research protocols. Produces structured JSON output for clinical research and trial coordination workflows.","url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-date-calculator-f4cad0352e6c","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-date-calculator-f4cad0352e6c","markdown_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-date-calculator-f4cad0352e6c.md","download_url":"https:\/\/skillshunter.net\/skills\/github-aipoch-medical-research-skills-scientific-skills-other-date-calculator-f4cad0352e6c\/download","category":{"slug":"data-research","name":"Data & Research"},"editor_note":"The script requires a calculation type (`gestational` or `followup`) and a reference date in `YYYY-MM-DD` format. If `scripts\/main.py` fails or a required parameter is absent, the fallback path will report the missing parameter, any partial calculation that is still valid, and the manual formula for the requested calculation type.","instructions":"---\nname: date-calculator\ndescription: Calculate medical date windows including gestational age, estimated delivery dates, and follow-up visit scheduling. Produces structured JSON output for clinical research and trial coordination workflows.\nlicense: MIT\nauthor: AIPOCH\n---\n> **Source**: [https:\/\/github.com\/aipoch\/medical-research-skills](https:\/\/github.com\/aipoch\/medical-research-skills)\n\n# Date Calculator\n\nCalculate medical date windows for clinical research: gestational age from LMP, estimated delivery dates, and follow-up visit scheduling with configurable window sizes.\n\n## Quick Check\n\n```bash\npython -m py_compile scripts\/main.py\npython scripts\/main.py --help\n```\n\n## When to Use\n\n- Computing gestational age and estimated delivery date from last menstrual period\n- Scheduling follow-up visit windows for clinical trials\n- Generating date ranges for protocol-defined visit windows\n\n## Workflow\n\n1. Confirm the user objective, required inputs, and non-negotiable constraints before doing detailed work.\n2. Validate that the request matches the documented scope and stop early if the task would require unsupported assumptions.\n3. Use the packaged script path or the documented reasoning path with only the inputs that are actually available.\n4. Return a structured result that separates assumptions, deliverables, risks, and unresolved items.\n5. If execution fails or inputs are incomplete, switch to the fallback path and state exactly what blocked full completion.\n\n**Note on group parameter:** If `--group` is not provided, log-rank test and Cox regression are skipped. Single-arm KM only. An informational note will be included in the output.\n\n**Fallback template:** If `scripts\/main.py` fails or a required parameter is absent, report: (a) which parameter is missing, (b) what partial calculation is still valid, (c) the manual formula for the requested calculation type.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `--type`, `-t` | string | Yes | Calculation type: `gestational` or `followup` |\n| `--date`, `-d` | string | Yes | Reference date in `YYYY-MM-DD` format |\n| `--weeks` | int | No | Follow-up interval in weeks (default: 4; must be \u2265 1) |\n| `--window-days` | int | No | Visit window size in days (default: 7) |\n| `--timezone` | string | No | Timezone for calculation (default: UTC) |\n| `--output`, `-o` | string | No | Output JSON file path (default: stdout) |\n\n## Usage\n\n```text\n# Gestational age from LMP\npython scripts\/main.py --type gestational --date 2024-01-15\n\n# 4-week follow-up window\npython scripts\/main.py --type followup --date 2024-03-01\n\n# Custom 6-week follow-up with \u00b15-day window\npython scripts\/main.py --type followup --date 2024-03-01 --weeks 6 --window-days 5\n```\n\n## Output Format\n\n**Gestational:**\n```json\n{\n  \"lmp_date\": \"2024-01-15\",\n  \"gestational_age\": \"12 weeks 3 days\",\n  \"gestational_age_days\": 87,\n  \"estimated_delivery_date\": \"2024-10-21\",\n  \"calculation_date\": \"2024-04-12\",\n  \"warning\": \"LMP date is in the future; gestational age calculated from today may be negative or unexpected\"\n}\n```\n\n**Follow-up:**\n```json\n{\n  \"start_date\": \"2024-03-01\",\n  \"followup_weeks\": 4,\n  \"window_start\": \"2024-03-29\",\n  \"window_end\": \"2024-04-05\",\n  \"window_range\": \"2024-03-29 to 2024-04-05\"\n}\n```\n\n## Output Requirements\n\nEvery response must make these explicit:\n\n- Objective and deliverable\n- Inputs used and assumptions introduced\n- Workflow or decision path taken\n- Core result: calculated dates and windows\n- Constraints, risks, caveats (e.g., timezone assumptions, calendar edge cases)\n- Unresolved items and next-step checks\n\n## Input Validation\n\nThis skill accepts: medical date calculation requests specifying a calculation type (`gestational` or `followup`) and a reference date in `YYYY-MM-DD` format.\n\nIf the request does not involve medical date window calculation \u2014 for example, asking to schedule general appointments, perform time-zone conversions unrelated to clinical dates, or calculate non-medical intervals \u2014 do not proceed. Instead respond:\n\n> \"`date-calculator` is designed to calculate medical date windows for clinical research. Your request appears to be outside this scope. Please provide a calculation type and reference date, or use a more appropriate tool for your task.\"\n\n**Validation rules:**\n- Date must be in `YYYY-MM-DD` format; invalid formats are rejected with exit code 1.\n- If LMP date is in the future, a `warning` field is included in the output.\n- `--weeks` must be \u2265 1; zero or negative values are rejected with a clear error message.\n- `--timezone` defaults to UTC; use pytz timezone names (e.g., `America\/New_York`).\n\n## Error Handling\n\n- If required inputs are missing, state exactly which fields are missing and request only the minimum additional information.\n- If the task goes outside the documented scope, stop instead of guessing or silently widening the assignment.\n- If `scripts\/main.py` fails, report the failure point, summarize what still can be completed safely, and provide a manual fallback.\n- Do not fabricate files, citations, data, search results, or execution outcomes.\n\n## Response Template\n\n1. Objective\n2. Inputs Received\n3. Assumptions\n4. Workflow\n5. Deliverable\n6. Risks and Limits\n7. Next Checks\n","use_cases":["Calculate gestational age from last menstrual period (LMP) for pregnant patients","Schedule follow-up visit windows for clinical trial participants","Generate date ranges for protocol-defined visit windows in clinical research"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/aipoch\/medical-research-skills\/blob\/686e09dfdb45d9fa1a08664f06bb93769b3c9d91\/scientific-skills\/Other\/date-calculator\/SKILL.md","source_commit":"686e09dfdb45d9fa1a08664f06bb93769b3c9d91","license":"MIT","version":null,"listing_approved_at":"2026-11-26","created_at":"2026-11-24T14:41:01.000000Z","updated_at":"2026-11-26T09:24:51.000000Z","seo_title":"Medical Date Calculator for Clinical Research","seo_description":"Calculate gestational age, estimated delivery dates, and follow-up visit windows for clinical trials and research protocols. Produces structured JSON output for clinical","seo_keywords":["medical date calculator","gestational age calculator","clinical trial date scheduling","follow-up visit window calculator","estimated delivery date calculator"]}}