Hay más ejemplos de AWS SDK disponibles en el GitHub repositorio de ejemplos de AWS Doc SDK
Las traducciones son generadas a través de traducción automática. En caso de conflicto entre la traducción y la version original de inglés, prevalecerá la version en inglés.
HealthLake ejemplos de uso del SDK para SAP ABAP
Los siguientes ejemplos de código muestran cómo realizar acciones e implementar escenarios comunes mediante el uso del AWS SDK para SAP ABAP con. HealthLake
Las acciones son extractos de código de programas más grandes y deben ejecutarse en contexto. Mientras las acciones muestran cómo llamar a las distintas funciones de servicio, es posible ver las acciones en contexto en los escenarios relacionados.
En cada ejemplo se incluye un enlace al código de origen completo, con instrucciones de configuración y ejecución del código en el contexto.
Temas
Acciones
En el siguiente ejemplo de código, se muestra cómo utilizar CreateFHIRDatastore.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_datastore_name = 'MyHealthLakeDataStore' oo_result = lo_hll->createfhirdatastore( iv_datastorename = iv_datastore_name iv_datastoretypeversion = 'R4' ). MESSAGE 'Data store created successfully.' TYPE 'I'. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. CATCH /aws1/cx_hllinternalserverex INTO DATA(lo_internal_ex). lv_error = |Internal server error: { lo_internal_ex->av_err_code }-{ lo_internal_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_internal_ex. CATCH /aws1/cx_hllthrottlingex INTO DATA(lo_throttling_ex). lv_error = |Throttling error: { lo_throttling_ex->av_err_code }-{ lo_throttling_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_throttling_ex. ENDTRY.-
Para obtener más información sobre la API, consulte Crear FHIRDatastore en el AWS SDK para la referencia sobre la API ABAP de SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar DeleteFHIRDatastore.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_datastore_id = 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' oo_result = lo_hll->deletefhirdatastore( iv_datastoreid = iv_datastore_id ). MESSAGE 'Data store deleted successfully.' TYPE 'I'. CATCH /aws1/cx_hllaccessdeniedex INTO DATA(lo_access_ex). DATA(lv_error) = |Access denied: { lo_access_ex->av_err_code }-{ lo_access_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_access_ex. CATCH /aws1/cx_hllconflictexception INTO DATA(lo_conflict_ex). lv_error = |Conflict error: { lo_conflict_ex->av_err_code }-{ lo_conflict_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_conflict_ex. CATCH /aws1/cx_hllresourcenotfoundex INTO DATA(lo_notfound_ex). lv_error = |Resource not found: { lo_notfound_ex->av_err_code }-{ lo_notfound_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_notfound_ex. ENDTRY.-
Para obtener más información sobre la API, consulta Eliminar FHIRDatastore en el AWS SDK para ver la referencia sobre la API ABAP de SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar DescribeFHIRDatastore.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_datastore_id = 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' oo_result = lo_hll->describefhirdatastore( iv_datastoreid = iv_datastore_id ). DATA(lo_datastore_properties) = oo_result->get_datastoreproperties( ). IF lo_datastore_properties IS BOUND. DATA(lv_datastore_name) = lo_datastore_properties->get_datastorename( ). DATA(lv_datastore_status) = lo_datastore_properties->get_datastorestatus( ). MESSAGE 'Data store described successfully.' TYPE 'I'. ENDIF. CATCH /aws1/cx_hllresourcenotfoundex INTO DATA(lo_notfound_ex). DATA(lv_error) = |Resource not found: { lo_notfound_ex->av_err_code }-{ lo_notfound_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_notfound_ex. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). lv_error = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. ENDTRY.-
Para obtener más información sobre la API, consulta la sección Describe FHIRDatastore en el AWS SDK para ver la referencia sobre la API ABAP de SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar DescribeFHIRExportJob.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_datastore_id = 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' " iv_job_id = 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' oo_result = lo_hll->describefhirexportjob( iv_datastoreid = iv_datastore_id iv_jobid = iv_job_id ). DATA(lo_export_job_properties) = oo_result->get_exportjobproperties( ). IF lo_export_job_properties IS BOUND. DATA(lv_job_status) = lo_export_job_properties->get_jobstatus( ). MESSAGE |Export job status: { lv_job_status }.| TYPE 'I'. ENDIF. CATCH /aws1/cx_hllresourcenotfoundex INTO DATA(lo_notfound_ex). DATA(lv_error) = |Resource not found: { lo_notfound_ex->av_err_code }-{ lo_notfound_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_notfound_ex. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). lv_error = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. ENDTRY.-
Para obtener más información sobre la API, consulte Describe FHIRExport Job en el AWS SDK para la referencia de la API ABAP de SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar DescribeFHIRImportJob.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_datastore_id = 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' " iv_job_id = 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' oo_result = lo_hll->describefhirimportjob( iv_datastoreid = iv_datastore_id iv_jobid = iv_job_id ). DATA(lo_import_job_properties) = oo_result->get_importjobproperties( ). IF lo_import_job_properties IS BOUND. DATA(lv_job_status) = lo_import_job_properties->get_jobstatus( ). MESSAGE |Import job status: { lv_job_status }.| TYPE 'I'. ENDIF. CATCH /aws1/cx_hllresourcenotfoundex INTO DATA(lo_notfound_ex). DATA(lv_error) = |Resource not found: { lo_notfound_ex->av_err_code }-{ lo_notfound_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_notfound_ex. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). lv_error = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. ENDTRY.-
Para obtener más información sobre la API, consulte Describe FHIRImport Job en el AWS SDK para la referencia de la API ABAP de SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar ListFHIRDatastores.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. oo_result = lo_hll->listfhirdatastores( ). DATA(lt_datastores) = oo_result->get_datastorepropertieslist( ). DATA(lv_datastore_count) = lines( lt_datastores ). MESSAGE |Found { lv_datastore_count } data store(s).| TYPE 'I'. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. CATCH /aws1/cx_hllthrottlingex INTO DATA(lo_throttling_ex). lv_error = |Throttling error: { lo_throttling_ex->av_err_code }-{ lo_throttling_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_throttling_ex. ENDTRY.-
Para obtener más información sobre las API, consulta la lista FHIRDatastores en el AWS SDK para obtener información sobre las API ABAP de SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar ListFHIRExportJobs.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_datastore_id = 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' IF iv_submitted_after IS NOT INITIAL. oo_result = lo_hll->listfhirexportjobs( iv_datastoreid = iv_datastore_id iv_submittedafter = iv_submitted_after ). ELSE. oo_result = lo_hll->listfhirexportjobs( iv_datastoreid = iv_datastore_id ). ENDIF. DATA(lt_export_jobs) = oo_result->get_exportjobpropertieslist( ). DATA(lv_job_count) = lines( lt_export_jobs ). MESSAGE |Found { lv_job_count } export job(s).| TYPE 'I'. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. CATCH /aws1/cx_hllresourcenotfoundex INTO DATA(lo_notfound_ex). lv_error = |Resource not found: { lo_notfound_ex->av_err_code }-{ lo_notfound_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_notfound_ex. ENDTRY.-
Para obtener más información sobre la API, consulte Listar FHIRExport trabajos en el AWS SDK para obtener una referencia sobre la API ABAP de SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar ListFHIRImportJobs.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_datastore_id = 'a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' IF iv_submitted_after IS NOT INITIAL. oo_result = lo_hll->listfhirimportjobs( iv_datastoreid = iv_datastore_id iv_submittedafter = iv_submitted_after ). ELSE. oo_result = lo_hll->listfhirimportjobs( iv_datastoreid = iv_datastore_id ). ENDIF. DATA(lt_import_jobs) = oo_result->get_importjobpropertieslist( ). DATA(lv_job_count) = lines( lt_import_jobs ). MESSAGE |Found { lv_job_count } import job(s).| TYPE 'I'. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. CATCH /aws1/cx_hllresourcenotfoundex INTO DATA(lo_notfound_ex). lv_error = |Resource not found: { lo_notfound_ex->av_err_code }-{ lo_notfound_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_notfound_ex. ENDTRY.-
Para obtener más información sobre la API, consulte Listar FHIRImport trabajos en el AWS SDK para obtener una referencia sobre la API ABAP de SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar ListTagsForResource.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_resource_arn = 'arn:aws:healthlake:us-east-1:123456789012:datastore/fhir/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' DATA(lo_result) = lo_hll->listtagsforresource( iv_resourcearn = iv_resource_arn ). ot_tags = lo_result->get_tags( ). DATA(lv_tag_count) = lines( ot_tags ). MESSAGE |Found { lv_tag_count } tag(s).| TYPE 'I'. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. CATCH /aws1/cx_hllresourcenotfoundex INTO DATA(lo_notfound_ex). lv_error = |Resource not found: { lo_notfound_ex->av_err_code }-{ lo_notfound_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_notfound_ex. ENDTRY.-
Para obtener más información sobre la API, consulte ListTagsForResourcela referencia sobre la API ABAP del AWS SDK para SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar StartFHIRExportJob.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_job_name = 'MyExportJob' " iv_output_s3_uri = 's3://my-bucket/export/output/' " iv_kms_key_id = 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012' " iv_data_access_role_arn = 'arn:aws:iam::123456789012:role/HealthLakeExportRole' oo_result = lo_hll->startfhirexportjob( iv_jobname = iv_job_name io_outputdataconfig = NEW /aws1/cl_hlloutputdataconfig( io_s3configuration = NEW /aws1/cl_hlls3configuration( iv_s3uri = iv_output_s3_uri iv_kmskeyid = iv_kms_key_id ) ) iv_dataaccessrolearn = iv_data_access_role_arn iv_datastoreid = iv_datastore_id ). DATA(lv_job_id) = oo_result->get_jobid( ). MESSAGE |Export job started with ID { lv_job_id }.| TYPE 'I'. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. CATCH /aws1/cx_hllthrottlingex INTO DATA(lo_throttling_ex). lv_error = |Throttling error: { lo_throttling_ex->av_err_code }-{ lo_throttling_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_throttling_ex. CATCH /aws1/cx_hllaccessdeniedex INTO DATA(lo_access_ex). lv_error = |Access denied: { lo_access_ex->av_err_code }-{ lo_access_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_access_ex. ENDTRY.-
Para obtener más información sobre la API, consulte Start FHIRExport Job in AWS SDK para obtener una referencia sobre la API ABAP de SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar StartFHIRImportJob.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_job_name = 'MyImportJob' " iv_input_s3_uri = 's3://my-bucket/import/data.ndjson' " iv_job_output_s3_uri = 's3://my-bucket/import/output/' " iv_kms_key_id = 'arn:aws:kms:us-east-1:123456789012:key/12345678-1234-1234-1234-123456789012' " iv_data_access_role_arn = 'arn:aws:iam::123456789012:role/HealthLakeImportRole' oo_result = lo_hll->startfhirimportjob( iv_jobname = iv_job_name io_inputdataconfig = NEW /aws1/cl_hllinputdataconfig( iv_s3uri = iv_input_s3_uri ) io_joboutputdataconfig = NEW /aws1/cl_hlloutputdataconfig( io_s3configuration = NEW /aws1/cl_hlls3configuration( iv_s3uri = iv_job_output_s3_uri iv_kmskeyid = iv_kms_key_id ) ) iv_dataaccessrolearn = iv_data_access_role_arn iv_datastoreid = iv_datastore_id ). DATA(lv_job_id) = oo_result->get_jobid( ). MESSAGE |Import job started with ID { lv_job_id }.| TYPE 'I'. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. CATCH /aws1/cx_hllthrottlingex INTO DATA(lo_throttling_ex). lv_error = |Throttling error: { lo_throttling_ex->av_err_code }-{ lo_throttling_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_throttling_ex. CATCH /aws1/cx_hllaccessdeniedex INTO DATA(lo_access_ex). lv_error = |Access denied: { lo_access_ex->av_err_code }-{ lo_access_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_access_ex. ENDTRY.-
Para obtener más información sobre la API, consulte Start FHIRImport Job in AWS SDK para obtener una referencia sobre la API ABAP de SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar TagResource.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_resource_arn = 'arn:aws:healthlake:us-east-1:123456789012:datastore/fhir/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' lo_hll->tagresource( iv_resourcearn = iv_resource_arn it_tags = it_tags ). MESSAGE 'Resource tagged successfully.' TYPE 'I'. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. CATCH /aws1/cx_hllresourcenotfoundex INTO DATA(lo_notfound_ex). lv_error = |Resource not found: { lo_notfound_ex->av_err_code }-{ lo_notfound_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_notfound_ex. ENDTRY.-
Para obtener más información sobre la API, consulte TagResourcela referencia sobre la API ABAP del AWS SDK para SAP.
-
En el siguiente ejemplo de código, se muestra cómo utilizar UntagResource.
- SDK para SAP ABAP
-
nota
Hay más información al respecto. GitHub Busque el ejemplo completo y aprenda a configurar y ejecutar en el Repositorio de ejemplos de código de AWS
. TRY. " iv_resource_arn = 'arn:aws:healthlake:us-east-1:123456789012:datastore/fhir/a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6' lo_hll->untagresource( iv_resourcearn = iv_resource_arn it_tagkeys = it_tag_keys ). MESSAGE 'Resource untagged successfully.' TYPE 'I'. CATCH /aws1/cx_hllvalidationex INTO DATA(lo_validation_ex). DATA(lv_error) = |Validation error: { lo_validation_ex->av_err_code }-{ lo_validation_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_validation_ex. CATCH /aws1/cx_hllresourcenotfoundex INTO DATA(lo_notfound_ex). lv_error = |Resource not found: { lo_notfound_ex->av_err_code }-{ lo_notfound_ex->av_err_msg }|. MESSAGE lv_error TYPE 'I'. RAISE EXCEPTION lo_notfound_ex. ENDTRY.-
Para obtener más información sobre la API, consulte UntagResourcela referencia sobre la API ABAP del AWS SDK para SAP.
-