cdisc-org / DDF-RA

This is the repository for all code and documentation for the DDF-RA project.
MIT License
18 stars 1 forks source link

Multiple Template Support #354

Closed dih-cdisc closed 2 months ago

dih-cdisc commented 6 months ago

USDM would become more flexible if it could support multiple templates for a single study version. It might be that some documents are extracts of the protocol and not the full document

Child tickets:

Item Ticket
Model #405
CT #406
API #407
Rules #408
IG #411
Test Data #410
BSnoeijerCD commented 4 months ago

@dih-cdisc @EMuhlbradt @czwickl @ASL-rmarshall : See annotated picture below for my suggested update. The following changes are suggested:

BSnoeijerCD commented 3 months ago

@dih-cdisc , @EMuhlbradt , @czwickl, @ASL-rmarshall Changed overview of proposed changes based on our discussions during the scrum call today:

Documents_Ann_V2

Language code CT to consider:

BSnoeijerCD commented 3 months ago

Decisions during scrum:

ASL-rmarshall commented 3 months ago

Additional information regarding languages - the following is from the Data Formats section of the ODM v2.0 specification (it's also present in earlier versions):

A languageTag represents a natural language or a country-specific variant of a natural language. The allowed values are specified in IETF RFC 3066: Tags for the Identification of Languages. Note that a languageTag cannot be null.

Example: "fr-CA" denotes the French language, Canadian variant. See Section 3.2.1.1, TranslatedText, for a discussion of how languageTags are used.

ASL-rmarshall commented 3 months ago

@BSnoeijerCD

Decisions during scrum:

  • ...
  • move displayTitle to NarrativeContent class
  • add displaySectionNumber

I think there should be naming consistency (in terms of including or excluding "Section" in attribute names) for these pairs of attributes:

I have a slight preference for the second option.

ASL-rmarshall commented 3 months ago

@dih-cdisc @BSnoeijerCD Also worth documenting the initial thoughts for the API:

BSnoeijerCD commented 3 months ago

@dih-cdisc @BSnoeijerCD Also worth documenting the initial thoughts for the API:

  • StudyVersion should have a narrativeContentItems collection
  • NarrativeContent will reference a contentItem by identifier, so will need contentItemId instead of contentItem.

The id part will be added in the API as described in the IG: https://wiki.cdisc.org/display/USDMIGv4/USDM+API See #407

BSnoeijerCD commented 3 months ago

@dih-cdisc @EMuhlbradt @czwickl @ASL-rmarshall I made all the changes and aligned with the suggestion of Richard regarding displaySectionTitle At the last moment I also saw that since relationship to documentVersion is now plural it should be documentVersions I will upload the UML when branch 4.4 is available.

Documents_annotV3

ASL-rmarshall commented 3 months ago

@dih-cdisc @BSnoeijerCD Also worth documenting the initial thoughts for the API:

  • StudyVersion should have a narrativeContentItems collection
  • NarrativeContent will reference a contentItem by identifier, so will need contentItemId instead of contentItem.

I was just thinking about rules related to this and it struck me that putting the narrativeContentItems collection in StudyVersion feels a bit weird. NarrativeContent is defined within StudyDefinitionDocumentVersion, which is defined within StudyDefinitionDocument, which is defined within Study - so you'd be "building" a study definition document version using narrative content items that are not defined within the definitional hierarchy of the document version itself. Would you ever want to create a StudyDefinitionDocumentVersion that is not referenced by a StudyVersion? If so, where would the narrative content items come from?

I wonder if having the narrativeContentItems collection in Study might be better...

ASL-rmarshall commented 3 months ago

@BSnoeijerCD I think the cardinality for NarrativeContentItem.text needs to be changed from 0..1 to 1 - if you create an instance of NarrativeContentItem, you must populate text (if you don't need text you just wouldn't reference a NarrativeContentItem).

dih-cdisc commented 3 months ago

Additional information regarding languages - the following is from the Data Formats section of the ODM v2.0 specification (it's also present in earlier versions):

A languageTag represents a natural language or a country-specific variant of a natural language. The allowed values are specified in IETF RFC 3066: Tags for the Identification of Languages. Note that a languageTag cannot be null.

Example: "fr-CA" denotes the French language, Canadian variant. See Section 3.2.1.1, TranslatedText, for a discussion of how languageTags are used.

It seems to reference ISO 639 so that should probably be our reference for the Code class

dih-cdisc commented 3 months ago

@BSnoeijerCD

Decisions during scrum:

  • ...
  • move displayTitle to NarrativeContent class
  • add displaySectionNumber

I think there should be naming consistency (in terms of including or excluding "Section" in attribute names) for these pairs of attributes:

  • Either sectionTitle / displayTitle and sectionNumber / displayNumber
  • Or sectionTitle / displaySectionTitle and sectionNumber / displaySectionNumber

I have a slight preference for the second option.

Prefer the second option as well

BSnoeijerCD commented 3 months ago

@BSnoeijerCD I think the cardinality for NarrativeContentItem.text needs to be changed from 0..1 to 1 - if you create an instance of NarrativeContentItem, you must populate text (if you don't need text you just wouldn't reference a NarrativeContentItem).

Good point. I changed the text cardinality to 1 and uploaded UML to the 3-4 branch

BSnoeijerCD commented 3 months ago

@dih-cdisc sectionNumber and sectionTitle are required now. Can we make it optional (e.g. cardinality 0..1) to be more flexible in setting up the content? As discussed yesterday we can have pieces of text without title and/or number.

BSnoeijerCD commented 3 months ago

@dih-cdisc @ASL-marshall We changed the ref from studyVersion to StudyDefinitionDocumentVersion to 0..* Should we do that as well from StudyDesign to StudyDefinitionDocumentVersion? It is now stil 0..1 Or do we think that 1 design is only represented by 1 document?

ASL-rmarshall commented 3 months ago

@dih-cdisc @ASL-marshall We changed the ref from studyVersion to StudyDefinitionDocumentVersion to 0..* Should we do that as well from StudyDesign to StudyDefinitionDocumentVersion? It is now stil 0..1 Or do we think that 1 design is only represented by 1 document?

Yes, I think this probably needs to be changed to allow multiple document versions to be referenced for each StudyDesign. A single study design might be based on a study definition that is documented using multiple templates and/or languages. Unless you want to mark one particular type(/template/language) of study definition document as the "primary" documentation of the study definition, I think you have to allow references to any relevant document version.

This also raises a couple of questions about rules:

dih-cdisc commented 3 months ago

@dih-cdisc @BSnoeijerCD Also worth documenting the initial thoughts for the API:

  • StudyVersion should have a narrativeContentItems collection
  • NarrativeContent will reference a contentItem by identifier, so will need contentItemId instead of contentItem.

I was just thinking about rules related to this and it struck me that putting the narrativeContentItems collection in StudyVersion feels a bit weird. NarrativeContent is defined within StudyDefinitionDocumentVersion, which is defined within StudyDefinitionDocument, which is defined within Study - so you'd be "building" a study definition document version using narrative content items that are not defined within the definitional hierarchy of the document version itself. Would you ever want to create a StudyDefinitionDocumentVersion that is not referenced by a StudyVersion? If so, where would the narrative content items come from?

I wonder if having the narrativeContentItems collection in Study might be better...

This bit ... "Would you ever want to create a StudyDefinitionDocumentVersion that is not referenced by a StudyVersion? " I do not think you would. I think StudyVersion is the right level for the overall collection of NarrativeContentItems. It is the "collection of all the text needed for all of my documents for my version".

That said, in an implementation, there is no restriction on the implementation having two StudyVersions point to (link to) the same NarrativeContentItem (i.e the content does not change across versions). So we need a relationship in the UML from StudyVersion -> NarrativeContentItem (0..*) that acts as the main container. I think it is nicer tohave in the model rather than just in the API.

dih-cdisc commented 3 months ago

@dih-cdisc sectionNumber and sectionTitle are required now. Can we make it optional (e.g. cardinality 0..1) to be more flexible in setting up the content? As discussed yesterday we can have pieces of text without title and/or number.

Make them optional [0..1]

BSnoeijerCD commented 3 months ago

@dih-cdisc @BSnoeijerCD Also worth documenting the initial thoughts for the API:

  • StudyVersion should have a narrativeContentItems collection
  • NarrativeContent will reference a contentItem by identifier, so will need contentItemId instead of contentItem.

I was just thinking about rules related to this and it struck me that putting the narrativeContentItems collection in StudyVersion feels a bit weird. NarrativeContent is defined within StudyDefinitionDocumentVersion, which is defined within StudyDefinitionDocument, which is defined within Study - so you'd be "building" a study definition document version using narrative content items that are not defined within the definitional hierarchy of the document version itself. Would you ever want to create a StudyDefinitionDocumentVersion that is not referenced by a StudyVersion? If so, where would the narrative content items come from? I wonder if having the narrativeContentItems collection in Study might be better...

This bit ... "Would you ever want to create a StudyDefinitionDocumentVersion that is not referenced by a StudyVersion? " I do not think you would. I think StudyVersion is the right level for the overall collection of NarrativeContentItems. It is the "collection of all the text needed for all of my documents for my version".

That said, in an implementation, there is no restriction on the implementation having two StudyVersions point to (link to) the same NarrativeContentItem (i.e the content does not change across versions). So we need a relationship in the UML from StudyVersion -> NarrativeContentItem (0..*) that acts as the main container. I think it is nicer tohave in the model rather than just in the API.

Agree with Dave. If you would nest it in Study and assume the same content can be referred to from different versions then you would need version control for the narrative content class as well, given we have ordering and so included which will become more and more complex.

BSnoeijerCD commented 3 months ago

@dih-cdisc sectionNumber and sectionTitle are required now. Can we make it optional (e.g. cardinality 0..1) to be more flexible in setting up the content? As discussed yesterday we can have pieces of text without title and/or number.

Make them optional [0..1]

Done and uploaded to github 3.4 branch

BSnoeijerCD commented 3 months ago

Changed template to templateName in UML. See ticket #406