How to Define the Structure of FHIR Document/ Composition

I want define a Structure/Form of the FHIR Document and give one resource identifier to it, so that I can search the Composition by the Target Patient and the resource identifier, and generate the composition to Document.

If I use the StructureDefinition define the Document’s form as a new resource (or extended resource drive from Composition) , it is turn out to be a normal resource but a Composition which can generate to Document.

If I use the CapabilityStatement mechanism, I cannot find where to register the Document’s Structure/Form . Shoud I register it as a ValueSet which used in the composition.type?

To confirm, you’re wanting to define a generic structure for a document that you can use to generate different documents for different patients at different times?

Yes,Like CDA , not reference the CDA, but use the Composition to generate bundle which type is document

You can use a Composition to generate a document, but Composition, by itself, doesn’t know what the outer boundaries of the document are, only what the minimal contents are. If you want to know the outer boundaries, then you’ll need a set of interlinked StructureDefinitions which make use of the “aggregation” property on type to determine what must appear inside the Bundle vs. not. (As we work towards R4, we’re going to be experimenting with using GraphDefinition as a more efficient mechanism of doing this.)