import json
import hashlib


def default_observation(case_submitter_id, project_id, date, observation_type, line):
    """Creates a minimal observation."""
    js = json.dumps(line, separators=(',',':'))
    check_sum = hashlib.sha256(js.encode('utf-8')).hexdigest()

    return {
        "type": "observation",
        "cases": {"submitter_id": case_submitter_id},
        "submitter_id": '{}-{}-{}'.format(case_submitter_id, observation_type, check_sum),
        "project_id": project_id,
        "date": date,
        "observation_type": observation_type
    }