async function cleanup() {
  const promises = [];

  let url;
  for (url of urls) {
    let promise;
    
    if (url.includes("Patient")) {
      const patientIdRecord = await Patient.findByQrCode(url.split('/')[2]);
      promise = globals.fhirServer.delete(`/Patient/${patientIdRecord.id}`);
      try {
        await promise;
      }
      catch(error) {
        console.log("generalTest cleanup failed");
        globals.info(error);
      }
    }
    else {
      promise = globals.fhirServer.delete(`${url}`);
      promises.push(promise);
    }
  }

  await Promise.all(promises).catch((error) => {
    console.log("generalTest cleanup failed");
    globals.info(error);
  });
}
/**
 * Delete resources created from this test
 */
Delete resources created from this test
Delete resources created from this test
async function cleanup() {
  const promises = [];
  let url;
  for (url of urls) {
    let promise;
    if (url.includes("Patient")) {
      const patientIdRecord = await Patient.findByQrCode(url.split('/')[2]);
      promise = globals.fhirServer.delete(`/Patient/${patientIdRecord.id}`);
      try {
        await promise;
      }
      catch(error) {
        console.log("generalTest cleanup failed");
        globals.info(error);
      }
    }
    else {
      promise = globals.fhirServer.delete(`${url}`);
      promises.push(promise);
    }
  }
  await Promise.all(promises).catch((error) => {
    console.log("generalTest cleanup failed");
    globals.info(error);
  });
}
async function cleanup ( ) { const promises = [ ] ; let url ; for ( url of urls ) { let promise ; if ( url . includes ( "Patient" ) ) { const patientIdRecord = await Patient . findByQrCode ( url . split ( '/' ) [ 2 ] ) ; promise = globals . fhirServer . delete ( ` ${ patientIdRecord . id } ` ) ; try { await promise ; } catch ( error ) { console . log ( "generalTest cleanup failed" ) ; globals . info ( error ) ; } } else { promise = globals . fhirServer . delete ( ` ${ url } ` ) ; promises . push ( promise ) ; } } await Promise . all ( promises ) . catch ( ( error ) => { console . log ( "generalTest cleanup failed" ) ; globals . info ( error ) ; } ) ; }
Delete resources created from this test
Delete resources created from this test