Skip to content

1 - Create App DatabaseΒΆ

Infra

  1. Create a database to serve as the Leaf application database. This can be as simple as:

    CREATE DATABASE LeafDB 
    

    Tip

    We also recommend also creating a Leaf-specific SQL service account and password for the API to use, though this isn't a requirement

  2. Populate the database tables, stored procedures, and functions using the LeafDB.Schema.sql script.

  3. Populate the initialization data using the LeafDB.Init.sql script.

  4. Grant your account permissions for the application database:

    /* If using a service account - Optional but Recommended! */
    CREATE LOGIN <your_account> WITH PASSWORD = '<your_pass>'
    
    USE LeafDB
    GO
    
    CREATE USER <your_account> FOR LOGIN <your_account>
    
    GRANT SELECT,UPDATE,INSERT,DELETE,EXEC ON SCHEMA :: app TO <your_account>;
    GRANT SELECT,UPDATE,INSERT,DELETE,EXEC ON SCHEMA :: network TO <your_account>;
    GRANT SELECT,UPDATE,INSERT,DELETE,EXEC ON SCHEMA :: adm TO <your_account>;
    GRANT SELECT,UPDATE,INSERT,DELETE,EXEC ON SCHEMA :: auth TO <your_account>;
    GRANT SELECT,UPDATE,INSERT,DELETE,EXEC ON SCHEMA :: ref TO <your_account>;
    GRANT SELECT,UPDATE,INSERT,DELETE,EXEC ON SCHEMA :: rela TO <your_account>;
    
    /* If on Windows */
    GRANT ADMINISTER BULK OPERATIONS TO <your_account>;
    
    /* Else if on Linux */
    ALTER SERVER ROLE [sysadmin] ADD MEMBER <your_account>;
    
  5. Populate the CMS General Equivalence Mapping (GEMs) data using the LeafDB.GEMs.sql script. These allow the Concept search box to suggest ICD10 -> ICD9 or ICD9 -> ICD10 equivalents if users search for a specific ICD10/9 code.


Next: Step 2 - Configure App Server