@welshare/sdk
    Preparing search index...
    • Maps a DocumentReference submission to the Nillion schema format. Adds _id and ensures required fields are set.

      Parameters

      • formData: {
            author?: {
                display?: string;
                id?: string;
                identifier?: { system?: string; value?: string };
                reference?: string;
                type?: string;
            }[];
            category?: {
                coding?: {
                    code?: string;
                    display?: string;
                    system: string;
                    userSelected?: boolean;
                    version?: string;
                }[];
                text?: string;
            }[];
            content: {
                attachment: {
                    contentType?: string;
                    creation?: string;
                    data?: string;
                    duration?: number;
                    frames?: number;
                    hash?: string;
                    height?: number;
                    id?: string;
                    language?: string;
                    pages?: number;
                    size?: number;
                    title?: string;
                    url?: string;
                    width?: number;
                };
                profile?: (
                    | {
                        valueCoding: {
                            code?: string;
                            display?: string;
                            system: string;
                            userSelected?: boolean;
                            version?: string;
                        };
                    }
                    | { valueUri: string }
                )[];
            }[];
            date?: string;
            description?: string;
            id: string;
            meta?: { lastUpdated?: string; profile?: string[]; versionId?: string };
            resourceType: "DocumentReference";
            securityLabel?: {
                coding?: {
                    code?: string;
                    display?: string;
                    system: string;
                    userSelected?: boolean;
                    version?: string;
                }[];
                text?: string;
            }[];
            status: string;
            subject?: {
                display?: string;
                id?: string;
                identifier?: { system?: string; value?: string };
                reference?: string;
                type?: string;
            };
            type?: {
                coding?: {
                    code?: string;
                    display?: string;
                    system: string;
                    userSelected?: boolean;
                    version?: string;
                }[];
                text?: string;
            };
        }

        The DocumentReference submission

        • Optionalauthor?: {
              display?: string;
              id?: string;
              identifier?: { system?: string; value?: string };
              reference?: string;
              type?: string;
          }[]

          Who and/or what authored the document

        • Optionalcategory?: {
              coding?: {
                  code?: string;
                  display?: string;
                  system: string;
                  userSelected?: boolean;
                  version?: string;
              }[];
              text?: string;
          }[]

          Categorization of document - use DOCUMENT_CATEGORY_CONCEPTS

        • content: {
              attachment: {
                  contentType?: string;
                  creation?: string;
                  data?: string;
                  duration?: number;
                  frames?: number;
                  hash?: string;
                  height?: number;
                  id?: string;
                  language?: string;
                  pages?: number;
                  size?: number;
                  title?: string;
                  url?: string;
                  width?: number;
              };
              profile?: (
                  | {
                      valueCoding: {
                          code?: string;
                          display?: string;
                          system: string;
                          userSelected?: boolean;
                          version?: string;
                      };
                  }
                  | { valueUri: string }
              )[];
          }[]

          Document content - array of content elements. Each element has an attachment that references the Binary resource via url (e.g., "binary/{id}") and includes metadata like contentType, size, title.

        • Optionaldate?: string

          When this document reference was created

        • Optionaldescription?: string

          Human-readable description (title/summary)

        • id: string
        • Optionalmeta?: { lastUpdated?: string; profile?: string[]; versionId?: string }
        • resourceType: "DocumentReference"
        • OptionalsecurityLabel?: {
              coding?: {
                  code?: string;
                  display?: string;
                  system: string;
                  userSelected?: boolean;
                  version?: string;
              }[];
              text?: string;
          }[]

          Document security labels

        • status: string

          Document status: current | superseded | entered-in-error

        • Optionalsubject?: {
              display?: string;
              id?: string;
              identifier?: { system?: string; value?: string };
              reference?: string;
              type?: string;
          }

          Who/what is the subject of the document (typically patient reference)

        • Optionaltype?: {
              coding?: {
                  code?: string;
                  display?: string;
                  system: string;
                  userSelected?: boolean;
                  version?: string;
              }[];
              text?: string;
          }

          Kind of document (LOINC code) - use DOCUMENT_TYPE_CONCEPTS

      • controllerDID: string

        The "patient" / user DID (will become a reference)

      Returns {
          _id: string;
          author?: {
              display?: string;
              id?: string;
              identifier?: { system?: string; value?: string };
              reference?: string;
              type?: string;
          }[];
          category?: {
              coding?: {
                  code?: string;
                  display?: string;
                  system: string;
                  userSelected?: boolean;
                  version?: string;
              }[];
              text?: string;
          }[];
          content: {
              attachment: {
                  contentType?: string;
                  creation?: string;
                  data?: string;
                  duration?: number;
                  frames?: number;
                  hash?: string;
                  height?: number;
                  id?: string;
                  language?: string;
                  pages?: number;
                  size?: number;
                  title?: string;
                  url?: string;
                  width?: number;
              };
              profile?: (
                  | {
                      valueCoding: {
                          code?: string;
                          display?: string;
                          system: string;
                          userSelected?: boolean;
                          version?: string;
                      };
                  }
                  | { valueUri: string }
              )[];
          }[];
          date?: string;
          description?: string;
          id: string;
          meta?: { lastUpdated?: string; profile?: string[]; versionId?: string };
          resourceType: "DocumentReference";
          securityLabel?: {
              coding?: {
                  code?: string;
                  display?: string;
                  system: string;
                  userSelected?: boolean;
                  version?: string;
              }[];
              text?: string;
          }[];
          status: string;
          subject?: {
              display?: string;
              id?: string;
              identifier?: { system?: string; value?: string };
              reference?: string;
              type?: string;
          };
          type?: {
              coding?: {
                  code?: string;
                  display?: string;
                  system: string;
                  userSelected?: boolean;
                  version?: string;
              }[];
              text?: string;
          };
      }[]

      Array

      • _id: string
      • Optionalauthor?: {
            display?: string;
            id?: string;
            identifier?: { system?: string; value?: string };
            reference?: string;
            type?: string;
        }[]

        Who and/or what authored the document

      • Optionalcategory?: {
            coding?: {
                code?: string;
                display?: string;
                system: string;
                userSelected?: boolean;
                version?: string;
            }[];
            text?: string;
        }[]

        Categorization of document - use DOCUMENT_CATEGORY_CONCEPTS

      • content: {
            attachment: {
                contentType?: string;
                creation?: string;
                data?: string;
                duration?: number;
                frames?: number;
                hash?: string;
                height?: number;
                id?: string;
                language?: string;
                pages?: number;
                size?: number;
                title?: string;
                url?: string;
                width?: number;
            };
            profile?: (
                | {
                    valueCoding: {
                        code?: string;
                        display?: string;
                        system: string;
                        userSelected?: boolean;
                        version?: string;
                    };
                }
                | { valueUri: string }
            )[];
        }[]

        Document content - array of content elements. Each element has an attachment that references the Binary resource via url (e.g., "binary/{id}") and includes metadata like contentType, size, title.

      • Optionaldate?: string

        When this document reference was created

      • Optionaldescription?: string

        Human-readable description (title/summary)

      • id: string
      • Optionalmeta?: { lastUpdated?: string; profile?: string[]; versionId?: string }
      • resourceType: "DocumentReference"
      • OptionalsecurityLabel?: {
            coding?: {
                code?: string;
                display?: string;
                system: string;
                userSelected?: boolean;
                version?: string;
            }[];
            text?: string;
        }[]

        Document security labels

      • status: string

        Document status: current | superseded | entered-in-error

      • Optionalsubject?: {
            display?: string;
            id?: string;
            identifier?: { system?: string; value?: string };
            reference?: string;
            type?: string;
        }

        Who/what is the subject of the document (typically patient reference)

      • Optionaltype?: {
            coding?: {
                code?: string;
                display?: string;
                system: string;
                userSelected?: boolean;
                version?: string;
            }[];
            text?: string;
        }

        Kind of document (LOINC code) - use DOCUMENT_TYPE_CONCEPTS