2021-08-21 update: Moved to dedicated project at https://www.drupal.org/project/schema_medical_entity
###
Our client needed support for MedicalEntity and several related subtypes. I went ahead and built out a full submodule for this, posted here as a patch. Its also available at https://www.drupal.org/sandbox/natemow/3116005 -- code review available at https://pareview.sh/pareview/https-git.drupal.org-sandbox-natemow-311600....
Hopefully this patch can be applied as-is but let me know if there are any changes that you'd like to see first.
The module creates the following Schema.org object types:
- Schema.org/MedicalEntity
- Schema.org/AnatomicalStructure
- Schema.org/AnatomicalSystem
- Schema.org/LifestyleModification
- Schema.org/MedicalCause
- Schema.org/MedicalCondition
- Schema.org/MedicalContraindication
- Schema.org/MedicalDevice
- Schema.org/MedicalGuideline
- Schema.org/MedicalIndication
- Schema.org/MedicalIntangible
- Schema.org/MedicalProcedure
- Schema.org/MedicalRiskEstimator
- Schema.org/MedicalRiskFactor
- Schema.org/MedicalStudy
- Schema.org/MedicalTest
- Schema.org/Substance
- Schema.org/SuperficialAnatomy
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | schema-medical-entity.patch | 190.93 KB | natemow |
| #16 | schema-medical-entity.patch | 190.59 KB | ciprian.jitaru |
| #12 | schema-medical-entity.patch | 188.47 KB | ciprian.jitaru |
| #11 | schema-medical-entity.patch | 190.57 KB | ciprian.jitaru |
| #8 | schema-medical-entity.patch | 188.72 KB | johan.gant |
Comments
Comment #2
natemow commentedComment #3
natemow commentedPatch updated with a bug fix in schema_medical_condition.
Comment #4
natemow commentedComment #5
natemow commentedExpanded to include all 17 subtypes and their property implementations (mostly text-based for now).
Comment #6
natemow commentedComment #7
natemow commentedComment #8
johan.gant commentedThis is great, thanks for your time putting this together. I noticed a fatal PHP error when using with 8.x-2.x when editing the default metatags:
I found other classes extending SchemaNameBase, so I quickly re-rolled the patch and it seems to work. I'm not massively familiar with the set up of the broader class hierarchy right now so I'm not 100% confident of the fix, per se.
Sharing the patch here regardless, while I have the time to do so.
Comment #9
karens commentedAll new features are going into 8.2. This patch needs a little work to adjust to that version. See documentation for 8.2.
Comment #10
drupaldope commentedI pretty much need this.
Is there a way to make this work with either 8.1 or 8.2? which patches, files should I use?
many thanks!
Comment #11
ciprian.jitaru commentedI've updated the patch to work with 8.2
Comment #12
ciprian.jitaru commentedFixed some Annotations errors.
Comment #13
damienmckennaComment #14
karens commentedThis module is getting too big. This feature could be added by creating a separate module to provide it which then keeps it from adding to the overhead of everyone who won't use it. I suggest doing that.
Comment #15
Vlad Stratulat commented@KarenS, why don't you want to have all types of Schemas in the same place?
Your modules add Schema.org Metatag after all and following https://schema.org, we can have https://schema.org/MedicalEntity or any other medical related schemas.
Your module is not named Schema.org Article or Schema.org Person, so why having separate module for Schema.org MedicalEntity?
Comment #16
ciprian.jitaru commentedHello, I've added some missing commas in the annotations.
Comment #17
drupaldope commentedexcellent, thank you very much!
Comment #18
natemow commentedPatch #16 updated to include D9 compatibility in .info.yml files. Thanks all for pushing this forward!
Comment #19
natemow commentedWent ahead and promoted my sandbox to a full project per @KarenS recs. A 2.2 release was added at https://www.drupal.org/project/schema_medical_entity ...all community contributions from this thread have been rolled in as well. @ciprianjitaru I also added you a maintainer on the project.
@vlad-stratulat I understand your point, and half-agree. But the volume of types in the schema.org hierarchy is growing all the time too -- which ultimately will result in a monolithic project here. I think we'd do well to break things up a bit...maybe a project per top-level type or something.