def __publish_to_topic()

in ingest_er7_service/ingest_er7_lambda.py [0:0]


def __publish_to_topic(msg, format, state, key):
  sns.publish(
    TopicArn=os.environ['topic'],
    Message=msg,
    MessageAttributes={
      'protocol': {
        'DataType': 'String',
        'StringValue': 'hl7v2',
      },
      'format': {
        'DataType': 'String',
        'StringValue': format,
      },
      'state': {
        'DataType': 'String',
        'StringValue': state,
      },
      'ingest_bucket': {
        'DataType': 'String',
        'StringValue': os.environ['bucket_name'],
      },
      'ingest_key': {
        'DataType': 'String',
        'StringValue': key,
      }
    }
  )