def get_latest_questionnaire_with_concept(self, codeId):
    'Find the questionnaire most recently modified that has the specified concept code.'
    with self.session() as session:
        return session.query(Questionnaire).join(Questionnaire.concepts).filter((QuestionnaireConcept.codeId == codeId)).order_by(Questionnaire.lastModified.desc()).options(subqueryload(Questionnaire.questions)).first()
Find the questionnaire most recently modified that has the specified concept code.
def get_latest_questionnaire_with_concept(self, codeId):
    
    with self.session() as session:
        return session.query(Questionnaire).join(Questionnaire.concepts).filter((QuestionnaireConcept.codeId == codeId)).order_by(Questionnaire.lastModified.desc()).options(subqueryload(Questionnaire.questions)).first()