Not medical advice. For research only; summaries are paraphrases.A living research archive of historical and continually changing sources, for research and personal reference only. Summaries are paraphrases: verify against the originals. Full disclaimer
Not medical advice. Full disclaimer
For research coding, not for diagnosis
| ICD-10-CM | ICD-11 | How it fits |
|---|---|---|
| F52.0 Hypoactive sexual desire disorder | HA00 Hypoactive sexual desire dysfunction | Core match for loss-of-libido criterion. Note: F52.0's tabular header excludes substance-induced cases; use alongside T-codes for post-drug framing. |
| F52.21 Male erectile disorder | HA01.1 Male erectile dysfunction | Core match for ED criterion (males). Use HA01.12 (acquired, generalized) in ICD-11 when post-drug onset is documented. |
| N52.2 Drug-induced erectile dysfunction | HA01.1 + NE60 (postcoordinated) Male erectile dysfunction + harmful effect of drug (cluster) | ICD-10-CM N52.2 explicitly captures drug-induced ED; pair with T-code for the agent. Useful for PFS cases where ED dominates. |
| F52.22 Female sexual arousal disorder | HA01.0 Female sexual arousal dysfunction | Female arousal/lubrication complaints (Healy 2022 ancillary: decreased vaginal lubrication). |
| F52.31 Female orgasmic disorder | HA02.0 Anorgasmia | Female orgasmic dysfunction / pleasureless orgasm. |
| F52.32 Male orgasmic disorder | HA02.0 Anorgasmia | Male anorgasmia / markedly diminished orgasmic sensation. Tabular includes delayed ejaculation. |
| F52.32 Male orgasmic disorder (delayed ejaculation inclusion term) | HA03.1 Male delayed ejaculation | For reduced ejaculatory force / delayed ejaculation (Healy 2022 ancillary symptom in males). |
| F52.4 Premature ejaculation | HA03.0 Male early ejaculation | Less central to PFS/PSSD; include for completeness of ejaculatory-dysfunction queries. |
| F52.8 Other sexual dysfunction not due to a substance or known physiological condition | HA0Y Other specified sexual dysfunctions | Catch-all for atypical presentations (e.g., flaccid glans during erection, reduced nipple sensitivity). |
| F52.9 Unspecified sexual dysfunction not due to a substance or known physiological condition | HA0Z Sexual dysfunctions, unspecified | Last-resort code; Healy 2024 notes cases scatter under vague labels like this. |
| ICD-10-CM | ICD-11 | How it fits |
|---|---|---|
| R20.0 Anesthesia of skin | MB40.3 Anaesthesia of skin | Best proxy for genital anesthesia/numbness. Symptom code; not a principal diagnosis once a definitive diagnosis is established. |
| R20.1 Hypoesthesia of skin | ME65 (parent) Disturbances of skin sensation of unspecified aetiology | Reduced genital sensitivity (partial loss). |
| R20.2 Paresthesia of skin | ME65.4 Tingling of skin | Tingling / pins-and-needles sensations; inclusion terms cover formication and tingling. |
| R20.8 Other disturbances of skin sensation | ME65.Y Other specified disturbance of skin sensation | Atypical sensory complaints not fitting above (e.g., altered erogenous sensation quality). |
| R20.9 Unspecified disturbances of skin sensation | ME65.Z Disturbances of skin sensation of unspecified aetiology, unspecified | Unspecified sensory complaint; verify ME65.Z in the WHO ICD-11 browser before use. |
| ICD-10-CM | ICD-11 | How it fits |
|---|---|---|
| F32.9 Major depressive disorder, single episode, unspecified | 6A70 Single episode depressive disorder | Depressive presentations; specify severity (F32.0-F32.3) when documented. |
| F33.9 Major depressive disorder, recurrent, unspecified | 6A71 Recurrent depressive disorder | Recurrent course; specify severity (F33.0-F33.2) when documented. |
| F32.A Depression, unspecified | 6A70 / 6A71 (per course) Single episode / recurrent depressive disorder | Added FY2025 for depression below full MDD criteria; commonly used when severity is undocumented. |
| F41.1 Generalized anxiety disorder | 6B00 Generalised anxiety disorder | Anxiety domain; #1 most-billed behavioral-health dx in the US. |
| R45.84 Anhedonia | (no standalone code; capture under 6A70/6A71) n/a: anhedonia is a defining symptom of depressive disorders in ICD-11 | Billable ICD-10-CM symptom code (FY2027 valid). Central to the anhedonia/low-libido PFS/PSSD subtype discussed in the library. |
| F48.1 Depersonalization-derealization disorder | 6B66 Depersonalisation-derealisation disorder | Healy 2022 ancillary non-sexual symptom (depersonalization). Verify 6B66 in WHO browser. |
| ICD-10-CM | ICD-11 | How it fits |
|---|---|---|
| R41.84 Other specified cognitive deficit | 6D71 Mild neurocognitive disorder | Best proxy for 'brain fog.' ICD-10-CM: code first the underlying condition if known. ICD-11 6D71 explicitly allows medication/substance-related etiology; highly relevant to post-drug framing. |
| R41.840 Attention and concentration deficit | 6D71 Mild neurocognitive disorder | More specific sub-code when attention/concentration is the documented deficit. |
| G47.00 Insomnia, unspecified | 7A00 Insomnia (chronic insomnia disorder grouping 7A00-7A0Z) | Sleep-disorder domain; use G47.0x subtypes when documented. |
| ICD-10-CM | ICD-11 | How it fits |
|---|---|---|
| R45.851 Suicidal ideations | MB26.A Suicidal ideation | Billable symptom code in both systems. Secondary code; pair with mood-disorder code when applicable. |
| T14.91XA Suicide attempt, initial encounter | MB23.R Suicide attempt (exclusion reference of MB26.A) | For attempt events (distinct from ideation). Verify MB23.R in WHO browser. |
| Z13.31 Encounter for screening for depression | QA45 (encounter for screening; verify) Screening encounter (verify exact QA code in WHO browser) | Screening code commonly used in research extracts to flag at-risk cohorts. Verify Z13.31/QA mapping against official tabulars before use. |
| Z91.5 Personal history of self-harm | QC4B Personal history of self-harm (exclusion reference of MB26.A) | History flag for longitudinal registry datasets. |
| ICD-10-CM | ICD-11 | How it fits |
|---|---|---|
| T43.225A / T43.225D / T43.225S Adverse effect of selective serotonin reuptake inhibitors (initial / subsequent / sequela) | NE60 + causative-agent postcoordination Harmful effects of drugs, medicaments or biological substances, NEC: cluster with the specific SRI | Direct T-code for SSRI adverse effects. The S (sequela) 7th character is the most appropriate for PSSD as a persistent post-discontinuation state. |
| T43.215A / T43.215D / T43.215S Adverse effect of selective serotonin and norepinephrine reuptake inhibitors | NE60 + causative-agent postcoordination Harmful effects of drugs, medicaments or biological substances, NEC | SNRI-triggered cases (Healy 2022: SRIs include SNRIs). |
| T43.205A / T43.205D / T43.205S Adverse effect of unspecified antidepressants | NE60 + causative-agent postcoordination Harmful effects of drugs, medicaments or biological substances, NEC | Fallback when the antidepressant class is undocumented. |
| T50.995A / T50.995D / T50.995S Adverse effect of other drugs, medicaments and biological substances | NE60 + causative-agent postcoordination Harmful effects of drugs, medicaments or biological substances, NEC | Bucket for finasteride, dutasteride, and isotretinoin; none has a dedicated ICD-10-CM T-code (finasteride is not a hormone, so T38 does not apply). S (sequela) 7th character fits PFS/PRSD persistence. |
| T88.7XXA Unspecified adverse effect of drug or medicament, initial encounter | NE60 Harmful effects of drugs, medicaments or biological substances, NEC | Only when the drug cannot be identified; prefer specific T-codes above. |
The code groups above say which codes fit. They do not say how to put them together, and the published criteria for these syndromes were written for a clinical interview rather than for a database. This section turns those criteria into logic a query can run, laid out the way a CMS electronic clinical quality measure is laid out, because that is the format epidemiology and EHR teams already read.
Read this before running any of it
An eCQM puts its caveats in a Guidance field rather than a footnote, because they change what the logic means. These are the ones that change what this logic means.
No ICD-10-CM or ICD-11 code names PSSD, PFS or post-retinoid sexual dysfunction, so no query can return cases of them. What this logic returns is a list of patients whose records are consistent with the published criteria and who are therefore worth reading by hand. Treat the count as the top of a funnel, and publish the chart-review yield next to it.
The criteria require that there be no pre-drug dysfunction matching the current profile, no current medical condition that could account for the symptoms, and no current medication or substance misuse that could. For PFS and post-retinoid cases they add that no other prior medication could account for them either. Absence of evidence in an extract is not evidence of absence, so the exclusions below are a coarse approximation and the rest of that judgment belongs to a reviewer.
For PSSD the necessary symptom criterion is an enduring change in somatic or erogenous genital sensation, which is the feature that separates these cases from a depressive relapse. No code names it. The nearest proxies are the skin-sensation codes in ICD-SENS-02, which are seldom applied to the genitals and seldom recorded at all. Expect low sensitivity: the cases that get coded tend to be coded as depression, anxiety, or sexual dysfunction unspecified.
CROSS-002 lists necessary items and then additional items, without stating how many of the additional ones must be met. That is a gap in the published criteria, not an omission here. The logic exposes it as the Minimum Additional Features parameter, set to one by default. Raise it for a narrower cohort, and state in your methods which value you used.
They require the problem to be present three months or more after treatment stops, and set no upper limit. The logic reads that as a qualifying record at least three months after the discontinuation date, plus a second record at least three months before it, which is the usual way to express endurance in record data and guards against a single late entry that is really a new complaint. The criteria also note that onset can lag the last dose by up to a couple of weeks, so the assessment window opens before the discontinuation date by the Onset Window parameter.
ICD-10-CM has adverse-effect T-codes for antidepressants (ICD-DRUG-06) but none that names 5-alpha-reductase inhibitors or retinoids, and T-codes are applied unevenly in any case. Ascertain exposure from prescribing or dispensing records keyed on RxNorm or ATC. Use the T-codes only as a supporting signal that some clinician attributed the problem to a drug, which is a useful thing to show a reviewer but a poor thing to select on.
The criteria say a PFS diagnosis needs no prior isotretinoin or serotonin reuptake inhibitor use, and a post-retinoid diagnosis needs no prior finasteride or serotonin reuptake inhibitor use. Patients exposed to more than one of the three classes still belong in the cohort, but they cannot be attributed to a single syndrome. The stratification gives them their own stratum rather than dropping them, because dropping them would bias the cohort toward people with simpler drug histories.
The asymmetry in the published criteria is easy to miss. For PSSD, necessary criterion 2 is specifically an enduring change in genital sensation, and reduced desire, erectile dysfunction and orgasmic change are additional. For PFS and post-retinoid dysfunction, necessary criterion 2 is enduring sexual dysfunction in general, and reduced genital and orgasmic sensation is additional criterion 5. The logic branches on the stratum rather than flattening the two into one rule.
To express this as a proportion measure in the NCQA style, keep the denominator as written, the patients who were exposed and have since stopped with enough follow-up, and make the numerator the patients meeting the symptom criteria. What you get is a documented-persistence rate, which measures recording practice at least as much as it measures incidence. Say so if you publish it.
Every choice the published criteria leave open is a parameter here rather than a number buried in the logic, so that two groups can run the same specification and report where they differed.
| Parameter | Type | Default | Why it exists |
|---|---|---|---|
| Observation Period | Interval<DateTime> | Implementer-set | The window in which encounters and symptom records are counted. |
| Exposure Lookback | Interval<DateTime> | 10 years before the end of the observation period | How far back to look for the index drug. The criteria set no limit and cases have been reported more than ten years out, so this is a data-availability choice, not a clinical one. Say what yours was. |
| Persistence Threshold | Quantity | 3 months | Criterion 6 in each of the three criteria sets, and the only numeric threshold they state. |
| Onset Window | Quantity | 14 days | The criteria note that onset can lag the last dose by up to a couple of weeks, so the assessment window opens this far before the discontinuation date. |
| Minimum Additional Features | Integer | 1 | Not specified by the published criteria. Raise it for specificity, and report the value you used. |
| Minimum Post-Discontinuation Follow-up | Quantity | 6 months | Patients who stopped too recently cannot yet meet the three-month rule, and without this they are counted as non-cases rather than as unassessable. |
| Refill Gap | Quantity | 60 days | The gap after the end of a days-supply that closes a treatment episode. Governs where the discontinuation date lands, so it changes the cohort more than any other parameter here. |
Adults with any exposure to one of the three drug classes in the lookback, and at least one encounter in which a symptom could have been recorded.
AgeInYearsAt(date from
start of "Observation Period"
)>= 18
and exists "Index Drug Exposure"
and exists "Qualifying Encounter"Those who have stopped, with enough follow-up afterwards that the three-month rule could be met. Patients still on treatment are not eligible: the criteria are about what endures after stopping.
"Initial Population"
and "Discontinuation Date" is not null
and "Discontinuation Date" + "Minimum Post-Discontinuation Follow-up"
on or before end of "Observation Period"The computable part of the three “there should be no” criteria. It is a coarse sieve, and it is meant to be: a reviewer makes the real call.
"Has Matching Sexual Dysfunction Before Index Exposure"
or "Has Competing Medical Cause"
or "Has Competing Concurrent Medication"
or "Has Index Drug Exposure During Assessment Period"Candidate cases. The necessary criterion is whichever one the stratum calls for, and the additional features have to clear the threshold parameter.
"Meets Necessary Criteria"
and "Additional Feature Count" >= "Minimum Additional Features"NoneA syndrome label is only available where the exposure was to one class. Multi-class patients stay in the cohort in a stratum of their own.
Stratum 1: "Index Class" = 'SRI' // PSSD candidates
Stratum 2: "Index Class" = '5ARI' // PFS candidates
Stratum 3: "Index Class" = 'Retinoid' // post-retinoid candidates
Stratum 4: "Index Class" = 'Multi-class' // in the cohort, not attributableAlphabetical, as an eCQM prints them. Names in double quotes refer to another definition, a parameter or a value set; names in single quotes are literals.
( ["Medication, Dispensed": "5 Alpha-Reductase Inhibitors"]
union ["Medication, Order": "5 Alpha-Reductase Inhibitors"] ) Exposure
where Exposure.relevantPeriod starts during "Exposure Lookback"Genital sensory change is counted here only for the 5-ARI and retinoid strata, where the criteria list it as additional item 5. In the serotonin reuptake inhibitor stratum it is the necessary criterion, and counting it twice would let one finding satisfy two requirements.
Count(
( { "Has Enduring Reduced Desire",
"Has Enduring Erectile Dysfunction",
"Has Enduring Orgasmic Dysfunction" }
union ( if "Index Class" = 'SRI'
then { }
else { "Has Enduring Genital Sensory Change" }
)
) Feature
where Feature is true
)( ["Diagnosis": "Sexual Dysfunction, Any"]
union ["Symptom": "Genital Sensory Disturbance"] ) Record
where Record.prevalencePeriod overlaps "Assessment Period"Opens before the discontinuation date by the onset window, because the criteria allow a short lag between the last dose and the start of symptoms.
Interval[
"Discontinuation Date" - "Onset Window",
end of "Observation Period"
]["Diagnosis": "Hypoactive Sexual Desire"] Desire
where Desire.prevalencePeriod overlaps "Assessment Period"In claims data there is no stop date to read, so derive it: collapse fills into episodes with TreatmentEpisodes, then take the end of the last one. This is the single most consequential line in the specification, because every window below hangs off it.
end of Last(
"TreatmentEpisodes"("Index Drug Exposure", "Refill Gap") Episode
sort by end of relevantPeriod
).relevantPeriod["Diagnosis": "Erectile Dysfunction"] ED
where ED.prevalencePeriod overlaps "Assessment Period"Count(
{ "SRI Exposure", "5ARI Exposure", "Retinoid Exposure" } Class
where exists Class
)The skin-sensation codes are not genital-specific. If your source has body-site qualifiers or free text, filter on them here and report how many records survived the filter.
["Symptom": "Genital Sensory Disturbance"] Sensory
where Sensory.prevalencePeriod overlaps "Assessment Period"exists ( ["Medication, Active": "Medications Affecting Sexual Function"] Other
where Other.relevantPeriod overlaps "Assessment Period"
)exists ( ["Diagnosis": "Conditions Accounting For Sexual Dysfunction"] Cause
where Cause.prevalencePeriod overlaps "Assessment Period"
)
or exists ( ["Procedure, Performed": "Procedures Accounting For Sexual Dysfunction"] Surgery
where Surgery.relevantPeriod starts on or before end of "Assessment Period"
)"Persists"("Erectile Dysfunction Records")"Persists"("Genital Sensory Records")"Persists"("Orgasmic Dysfunction Records")"Persists"("Desire Records")"Persists"("Any Sexual Dysfunction Records")A restart puts the patient back on treatment, and dysfunction while on the drug is explicitly not one of these syndromes.
exists ( "Index Drug Exposure" Exposure
where Exposure.relevantPeriod overlaps "Assessment Period"
)Criterion 7 asks for no pre-drug dysfunction matching the current profile. A query can only test for any recorded dysfunction before the first exposure, which is stricter in some records and far weaker in others. Keep the matched profile for the reviewer.
exists ( ( ["Diagnosis": "Sexual Dysfunction, Any"]
union ["Symptom": "Genital Sensory Disturbance"] ) Prior
where Prior.prevalencePeriod starts before start of "Index Exposure Period"
)case
when "Exposed Class Count" > 1 then 'Multi-class'
when exists "SRI Exposure" then 'SRI'
when exists "5ARI Exposure" then '5ARI'
when exists "Retinoid Exposure" then 'Retinoid'
else null
end"SRI Exposure"
union "5ARI Exposure"
union "Retinoid Exposure"Interval[
start of First(
"Index Drug Exposure" Exposure
sort by start of relevantPeriod
).relevantPeriod,
"Discontinuation Date"
]The branch the published criteria require. PSSD names genital sensation specifically; PFS and post-retinoid dysfunction name enduring sexual dysfunction generally. Multi-class patients get the general test, since no single syndrome's criteria apply to them.
case "Index Class"
when 'SRI' then "Has Enduring Genital Sensory Change"
else "Has Enduring Sexual Dysfunction"
end["Diagnosis": "Orgasmic Dysfunction"] Orgasm
where Orgasm.prevalencePeriod overlaps "Assessment Period"["Encounter, Performed": "Office Visit"] Visit
where Visit.relevantPeriod during "Assessment Period"( ["Medication, Dispensed": "Systemic Retinoids"]
union ["Medication, Order": "Systemic Retinoids"] ) Exposure
where Exposure.relevantPeriod starts during "Exposure Lookback"( ["Medication, Dispensed": "Serotonin Reuptake Inhibitors"]
union ["Medication, Order": "Serotonin Reuptake Inhibitors"] ) Exposure
where Exposure.relevantPeriod starts during "Exposure Lookback"Criterion 6, plus a guard. The first clause is the published rule: a record at least three months after stopping. The second requires a pair of records at least three months apart, so that one late entry on its own, which may be a new and unrelated complaint, does not qualify.
exists ( Records Confirming
where start of Confirming.prevalencePeriod
"Persistence Threshold" or more after "Discontinuation Date"
)
and exists ( Records Earlier
with Records Later
such that start of Later.prevalencePeriod
"Persistence Threshold" or more after start of Earlier.prevalencePeriod
)Written out rather than expressed in CQL, because this is where real implementations spend their time and where two groups running “the same” phenotype most often diverge. Report your gap and your handling of overlapping fills.
// Sort Fills by start date.
// Give each fill an end: its own end if recorded, else start + days supply,
// else start + the class's typical days supply (say so in your methods).
// Walk the sorted fills, holding an open episode:
// if the next fill starts within Gap of the open episode's end,
// extend the episode to the later of the two ends;
// otherwise close the episode and open a new one.
// Return the closed episodes, each as an Interval[first start, last end].No value set in VSAC covers any of these syndromes, so there are no OIDs to cite and none are invented here. The sets drawn from the library’s own code groups are listed with their members in full; the rest have to be authored locally, and the last column says what belongs in them. Publish whichever you build.
| Value set | Members | Drawn from / how to build it |
|---|---|---|
| Genital Sensory Disturbance pds-vs-genital-sensory-disturbance | ICD-10-CMR20.0, R20.1, R20.2, R20.8, R20.9 ICD-11MB40.3, ME65, ME65.4, ME65.Y, ME65.Z | ICD-SENS-02 Proxies, not a genital-specific set. R20.0 is the closest to genital anesthesia. None of these codes names a body site, so expect both false positives from unrelated neuropathy and heavy under-recording. |
| Hypoactive Sexual Desire pds-vs-hypoactive-desire | ICD-10-CMF52.0 ICD-11HA00 | ICD-SEX-01 F52.0's ICD-10-CM header excludes substance-induced cases, so a coder following the tabular strictly may avoid it for exactly the patients wanted here. Pair with the T-codes. |
| Erectile Dysfunction pds-vs-erectile-dysfunction | ICD-10-CMF52.21, N52.2 ICD-11HA01.1 | ICD-SEX-01 N52.2 is drug-induced erectile dysfunction, the one code in the library's groups that carries drug attribution in its own title. Worth counting separately as a high-specificity signal. |
| Orgasmic Dysfunction pds-vs-orgasmic-dysfunction | ICD-10-CMF52.31, F52.32 ICD-11HA02.0, HA03.1 | ICD-SEX-01 Covers anorgasmia and markedly reduced orgasmic pleasure in both sexes. F52.32 also carries delayed ejaculation as an inclusion term. |
| Sexual Dysfunction, Any pds-vs-sexual-dysfunction-any | ICD-10-CMF52.0, F52.21, F52.22, F52.31, F52.32, F52.4, F52.8, F52.9, N52.2 ICD-11HA00, HA01.0, HA01.1, HA02.0, HA03.0, HA03.1, HA0Y, HA0Z | ICD-SEX-01 The necessary criterion for the 5-ARI and retinoid strata. F52.9 is included because cases are known to scatter under unspecified labels, which is also why this set on its own is a weak signal. |
| Drug Adverse Effect, Supporting pds-vs-drug-adverse-effect | ICD-10-CMT43.205, T43.215, T43.225, T50.995, T88.7XXA ICD-11NE60 | ICD-DRUG-06 Not used to select patients. Assembled for the review packet, because a T-code means a clinician wrote down that a drug did this. The 7th character encodes initial, subsequent or sequela; the sequela character is the interesting one here. |
| Emotional Blunting, Supporting pds-vs-emotional-blunting | ICD-10-CMF48.1, R45.84 ICD-116B66 | ICD-PSYCH-03 Ancillary non-sexual features in CROSS-002, not criteria. For the review packet. Selecting on them would pull in the depression cases this logic is trying to distinguish itself from. |
| Cognitive Impairment, Supporting pds-vs-cognitive-impairment | ICD-10-CMR41.84, R41.840 ICD-116D71 | ICD-NEURO-04 Ancillary, for the review packet only. |
| Serotonin Reuptake Inhibitors pds-vs-serotonin-reuptake-inhibitors | Author locally | RxNorm ingredient concepts, or ATC N06AB for the SSRIs (citalopram, escitalopram, fluoxetine, fluvoxamine, paroxetine, sertraline) plus the SNRIs the library groups with them: venlafaxine N06AX16, milnacipran N06AX17, duloxetine N06AX21, desvenlafaxine N06AX23. The published criteria say “serotonin reuptake inhibitor”, which is broader than the library's SSRI and SNRI classes. Clomipramine (N06AA04) is the usual additional member. Decide whether to include it, and say which way you went. |
| 5 Alpha-Reductase Inhibitors pds-vs-5-alpha-reductase-inhibitors | Author locally | RxNorm ingredient concepts for finasteride and dutasteride, or ATC G04CB01 and G04CB02. Both the 1 mg and 5 mg finasteride products belong here. Dose and indication are worth keeping as covariates, since the alopecia and BPH populations differ in age and in almost everything else. |
| Systemic Retinoids pds-vs-systemic-retinoids | Author locally | RxNorm ingredient concepts for isotretinoin, or ATC D10BA01. Oral isotretinoin only. Topical isotretinoin (D10AD04) reaches nothing like the same systemic exposure and should be excluded, or kept as a separate comparison group. |
| Conditions Accounting For Sexual Dysfunction pds-vs-conditions-accounting | Author locally | Author locally: diabetic neuropathy, spinal cord injury, multiple sclerosis, hypogonadism, hyperprolactinemia, thyroid disease, peripheral vascular disease, pelvic or genital trauma, and the genitourinary cancers. Criterion 8. Keep this set public with your results: it is the set most likely to differ between two groups claiming to run the same phenotype, and a generous version of it will quietly remove most of the cohort. |
| Procedures Accounting For Sexual Dysfunction pds-vs-procedures-accounting | Author locally | Author locally: radical prostatectomy, pelvic radiotherapy, pelvic and genital surgery, orchiectomy. |
| Medications Affecting Sexual Function pds-vs-medications-affecting | Author locally | Author locally: antipsychotics, opioids, antiandrogens and GnRH analogs, spironolactone, and the antidepressants not in the index set. Criterion 9. Note the trap: an antidepressant started after the index drug stopped, perhaps for the distress these syndromes cause, will exclude the very patients the study is looking for. Decide whether a post-index start excludes, and say so. |
| Office Visit pds-vs-office-visit | Author locally | Reuse your existing outpatient encounter value set, or VSAC's Office Visit set if you have access. Only there to require a chance of recording. Patients with no outpatient contact cannot have symptoms documented, and counting them as non-cases understates the rate. |
"Diagnosis: Conditions Accounting For Sexual Dysfunction" using "Conditions Accounting For Sexual Dysfunction (local)"
"Diagnosis: Erectile Dysfunction" using "Erectile Dysfunction (local, from ICD-SEX-01)"
"Diagnosis: Hypoactive Sexual Desire" using "Hypoactive Sexual Desire (local, from ICD-SEX-01)"
"Diagnosis: Orgasmic Dysfunction" using "Orgasmic Dysfunction (local, from ICD-SEX-01)"
"Diagnosis: Sexual Dysfunction, Any" using "Sexual Dysfunction, Any (local, from ICD-SEX-01)"
"Encounter, Performed: Office Visit" using "Office Visit (local)"
"Medication, Active: Medications Affecting Sexual Function" using "Medications Affecting Sexual Function (local)"
"Medication, Dispensed: 5 Alpha-Reductase Inhibitors" using "5 Alpha-Reductase Inhibitors (local)"
"Medication, Dispensed: Serotonin Reuptake Inhibitors" using "Serotonin Reuptake Inhibitors (local)"
"Medication, Dispensed: Systemic Retinoids" using "Systemic Retinoids (local)"
"Medication, Order: 5 Alpha-Reductase Inhibitors" using "5 Alpha-Reductase Inhibitors (local)"
"Medication, Order: Serotonin Reuptake Inhibitors" using "Serotonin Reuptake Inhibitors (local)"
"Medication, Order: Systemic Retinoids" using "Systemic Retinoids (local)"
"Patient Characteristic Birthdate: Birth date" using "Birth date (LOINC Code 21112-8)"
"Patient Characteristic Sex: Sex" using "Sex (local)"
"Procedure, Performed: Procedures Accounting For Sexual Dysfunction" using "Procedures Accounting For Sexual Dysfunction (local)"
"Symptom: Genital Sensory Disturbance" using "Genital Sensory Disturbance (local, from ICD-SENS-02)"The same logic against FHIR resources, for teams running on a FHIR server rather than a claims warehouse. Packaged as a Measure with scoring = cohort and the CQL in a Library, the whole specification becomes something a second site can run with their own parameters.
| What it holds | Resource | Elements | Notes |
|---|---|---|---|
| Index drug exposure | MedicationDispense, MedicationRequest | medicationCodeableConcept, whenHandedOver, daysSupply, authoredOn | Prefer dispense over request. A request says what was intended, a dispense says what was collected, and neither says what was swallowed. |
| Discontinuation date | MedicationDispense | whenHandedOver + daysSupply, confirmed by the absence of a later dispense | There is no element that reliably records stopping. MedicationRequest.status = stopped exists but is written inconsistently, and MedicationStatement.effectivePeriod.end is often open. Derive it. |
| Symptom and diagnosis records | Condition | code, clinicalStatus, onsetDateTime, recordedDate, abatementDateTime | Query with Condition?code:in=<ValueSet canonical url>. Sensory findings also turn up in Observation, and patient-reported items in QuestionnaireResponse, so searching Condition alone will miss cases. |
| Persistence | Condition, Observation | two instances compared on recordedDate, or onsetDateTime where populated | An active clinicalStatus with no abatementDateTime is weaker evidence than two dated records: problem lists go stale in the direction of staying open. |
| Competing medical cause | Condition, Procedure | Condition.code, Procedure.code, Procedure.performedDateTime | |
| Competing concurrent medication | MedicationRequest, MedicationStatement | medicationCodeableConcept, effectivePeriod, authoredOn | |
| Qualifying encounter | Encounter | class, period, type | |
| Age and sex | Patient | birthDate, gender | Patient.gender is administrative. Where the server implements US Core, sex-for-clinical-use is the better element for anything that branches on anatomy, as the erectile dysfunction feature does. |
| Value sets | ValueSet | $expand, compose.include.concept | Publish each set as a ValueSet resource with a canonical url and a version, so the cohort can be rebuilt later. Code lists in a paper's appendix cannot be re-run. |
| The specification itself | Library, Measure | Measure.scoring = cohort, Measure.group.population with initial-population, denominator, denominator-exclusion and numerator codes | Carry the CQL in a Library resource referenced from Measure.library. The parameters above become Library.parameter, which is what lets a second site run your logic with their own refill gap and report both. |
| The result | MeasureReport | $evaluate-measure with reportType = subject-list | The subject list is the review queue. A summary MeasureReport gives a count, which is the one thing this logic cannot responsibly be reduced to. |
For implementing against SQL, a common data model such as OMOP, or anything else that is not CQL. The steps are in order, and each one says what leaves the cohort, because the attrition is the part worth publishing.
Every prescription or dispensing of a drug in the three classes, one row per fill, with the patient, the date, the days supply and the class.
Leaves the cohort: Patients never exposed to any of the three classes.
Close an episode when the gap after the end of a days-supply exceeds the refill gap. The end of the last episode is the discontinuation date.
Leaves the cohort: Patients still on treatment at the end of the observation period.
The discontinuation date plus the minimum follow-up has to fall inside the observation period, so that a three-month persistence test is possible at all.
Leaves the cohort: Recent stoppers, who are unassessable rather than negative. Count them separately.
One class, or more than one. This sets the stratum and decides which necessary criterion will be applied in step 7.
Leaves the cohort: Nothing. Multi-class patients go to their own stratum.
The window opens at the discontinuation date minus the onset window and runs to the end of the observation period. Pull the sensory, desire, erectile and orgasmic sets separately: you need the counts per feature later.
Leaves the cohort: Nothing yet.
A qualifying record three months or more after the discontinuation date, and a pair of records three months or more apart.
Leaves the cohort: Transient dysfunction, which the published criteria exclude by design.
Genital sensory change for the serotonin reuptake inhibitor stratum. Any enduring sexual dysfunction for the 5-ARI, retinoid and multi-class strata.
Leaves the cohort: Patients with persistent symptoms that do not include the stratum's required feature.
One by default. Do not count the stratum's necessary feature again as an additional one.
Leaves the cohort: Patients below the minimum additional features.
Matching dysfunction recorded before the first exposure, a competing medical cause, a competing concurrent medication, or any index-drug exposure inside the assessment window.
Leaves the cohort: Patients the criteria would rule out on paper, and some genuine cases: prior-dysfunction and competing-cause rules are blunt in record data.
Drug history with dates, the symptom timeline, the supporting T-codes, the ancillary findings, and every competing cause the query found. The three “there should be no” criteria are decided here, not by the query.
Leaves the cohort: Whatever review rejects. Record the reasons: they are how the next version of this logic gets better.
A count at every step above, the parameter values you used, and the positive predictive value from a reviewed random sample.
Leaves the cohort: Nothing, but a cohort count published without these two numbers cannot be interpreted by anyone, including you.
Corrections welcome, and expected