sudo defaults write /Library/Preferences/com.apple.alf globalstate -int 1
| const createPatient = async (accountId: string, projectId: string) => { | |
| const patient = await fetch(`https://fhir.us.lifeomic.com/${accountId}/dstu3/Patient`, { | |
| method: 'POST', | |
| headers: { | |
| authorization: `Bearer ${process.env.PHC_API_KEY}`, | |
| 'content-type': 'application/json' | |
| }, | |
| body: JSON.stringify({ | |
| resourceType: "Patient", | |
| const createObservation = async (accountId: string, projectId: string, patientId: string) => { | |
| const observation = await fetch(`https://fhir.us.lifeomic.com/${accountId}/dstu3/Observation`, { | |
| method: 'POST', | |
| headers: { | |
| authorization: `Bearer ${process.env.PHC_API_KEY}`, | |
| 'content-type': 'application/json' | |
| }, | |
| body: JSON.stringify({ | |
| resourceType: "Observation", | |
| AWSTemplateFormatVersion: 2010-09-09 | |
| Parameters: | |
| env: | |
| Type: String | |
| authCognitoResourceUserPoolId: | |
| Type: String | |
| Mappings: | |
| CustomAuthDomains: |
| { | |
| "auth": { | |
| "domain": { | |
| "providerPlugin": "awscloudformation", | |
| "dependsOn": [ | |
| { | |
| "category": "auth", | |
| "resourceName": "CognitoResource", | |
| "attributes": [ | |
| "UserPoolId" |
| import awsconfig from "./aws-exports"; | |
| import Amplify from "@aws-amplify/core"; | |
| // Find the User Pool ID for your production deployment in | |
| // the AWS Console | |
| if (awsconfig.aws_user_pools_id === "us-east-1_M7n6RNrq9") { | |
| awsconfig.oauth.domain = "auth.yourdomain.com; | |
| } | |
| Amplify.configure(awsconfig); |
| #!/usr/bin/env bash | |
| set -e | |
| IFS='|' | |
| help_output () { | |
| echo "usage: amplify-push <--environment|-e <name>> <--simple|-s>" | |
| echo " --environment The name of the Amplify environment to use" | |
| echo " --simple Optional simple flag auto-includes stack info from env cache" | |
| exit 1 | |
| } |
| // This is the attribute that continuation local storage uses to hold onto | |
| // the current context. The value comes from https://github.com/othiym23/node-continuation-local-storage/blob/fc770288979f6050e4371c1e1b44d2b76b233664/context.js#L11 | |
| const CLS_CONTEXT_ATTRIBUTE = 'error@context'; | |
| // A formatError function that can be used with | |
| // https://www.apollographql.com/docs/apollo-server/features/errors#for-the-client-response | |
| function formatError (err) { | |
| // The continuation-local-storage module attaches a context attribute to | |
| // errors so that the context can be resolved from errors. The attribute | |
| // is enumerable by default and so it gets included in GraphQL error |
| function safePromise (promise, timeout) { | |
| let slowOpId; | |
| const slowLoggingPromise = pFinally(promise, function () { | |
| if (slowOpId) { | |
| log.warn({slowOpId, itemKey}, 'The Promise eventually resolved'); | |
| } | |
| }); | |
| // Don't wait on longer than `timeout` ms for the Promise |
| function someAsyncFunction () { | |
| return new Promise(function () { | |
| // This is a bad promise that never resolves | |
| }); | |
| } | |
| someAsyncFunction() | |
| .then(function () { | |
| console.log('Done'); | |
| }) |